DateDateMidnightConverter implements TypeConverter<Date, DateMidnight> { @Override public Date reverse(DateMidnight object, SyntheticField toField, Object toObject, String... tags) throws JTransfoException { if (null == object) { return null; } return object.toDate(); }  @Override boolean canConvert(Type realToType, Type realDomainType); @Override DateMidnight convert(Date object, SyntheticField domainField, Object domainObject, String... tags); @Override Date reverse(DateMidnight object, SyntheticField toField, Object toObject, String... tags);  }
@Test public void testReverse() throws Exception { assertThat(typeConverter.reverse(null, null, null)).isNull(); assertThat(typeConverter.reverse(dm1, null, null)).isEqualTo(dm1.toDate()); assertThat(typeConverter.reverse(dm2, null, null)).isEqualTo(dm2.toDate()); assertThat(typeConverter.reverse(dm3, null, null)).isEqualTo(dm3.toDate()); }