DateMatcher implements Transform<Date> { public synchronized String write(Date value) { return df.format(value); } DateMatcher(String format); synchronized Date read(String value); synchronized String write(Date value);  }
@Test public void shouldWriteDateAsDateStr(){ assertEquals(DATE_STR, toTest.write(DATE)); }
@Test(expected = NullPointerException.class) public void shouldntWriteNull(){ toTest.write(null); }