DateMatcher implements Transform<Date> { public synchronized Date read(String value) throws ParseException { return df.parse(value); } DateMatcher(String format); synchronized Date read(String value); synchronized String write(Date value);  }
@Test public void shouldReadDate() throws ParseException { assertEquals(DATE.toString(), toTest.read(DATE_STR).toString()); }
@Test(expected = ParseException.class) public void shouldntReadDate() throws ParseException { toTest.read("dfdsf"); }
@Test(expected = NullPointerException.class) public void shouldntNull() throws ParseException { toTest.read(null); }