DateDateTimeConverter implements TypeConverter<Date, DateTime> { @Override public boolean canConvert(Type realToType, Type realDomainType) { return Date.class.equals(realToType) && DateTime.class.equals(realDomainType); }  @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 testCanConvert() throws Exception { assertThat(typeConverter.canConvert(Date.class, DateTime.class)).isTrue(); assertThat(typeConverter.canConvert(java.sql.Date.class, DateTime.class)).isFalse(); assertThat(typeConverter.canConvert(Object.class, DateTime.class)).isFalse(); assertThat(typeConverter.canConvert(Date.class, String.class)).isFalse(); assertThat(typeConverter.canConvert(Gender.class, String.class)).isFalse(); }