DateDateTimeConverter implements TypeConverter<Date, DateTime> { @Override public DateTime convert(Date object, SyntheticField domainField, Object domainObject, String... tags) throws JTransfoException { if (null == object) { return null; } return new DateTime(object.getTime()); }  @Override boolean canConvert(Type realToType, Type realDomainType); @Override DateTime convert(Date object, SyntheticField domainField, Object domainObject, String... tags); @Override Date reverse(DateTime object, SyntheticField toField, Object toObject, String... tags);  }
@Test public void testConvert() throws Exception { assertThat(typeConverter.convert(null, null, null)).isNull(); assertThat(typeConverter.convert(dt1.toDate(), null, null)).isEqualTo(dt1); assertThat(typeConverter.convert(dt2.toDate(), null, null)).isEqualTo(dt2); assertThat(typeConverter.convert(dt3.toDate(), null, null)).isEqualTo(dt3); }