@Test public void testEntry() { final Map<String, Integer> nums = new HashMap<String, Integer>(); nums.put("Foo", 42); final MapEntryAdapter<String, Integer> adapter = Adapters.entryFor("Foo"); assertThat(adapter.adapt(nums), is(42)); }
@Test public void testBadCast() { assertThat(Adapters.cast(Integer.class).adapt("No time"), is(nullValue())); }
@Test public void testInalidParseInteger() { assertThat(Adapters.parseInt().adapt("SEVEN"), is(nullValue())); }
@Test public void testCastingAdapter() { assertThat(Adapters.cast(String.class).adapt("No time"), is("No time")); }
@Test public void testValidParseInteger() { assertThat(Adapters.parseInt().adapt("42"), is(42)); }