InstantConverter implements PropertyConverter<Instant> { @Override public int hashCode(){ return getClass().hashCode(); }  @Override Instant convert(String value, ConversionContext ctx); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void equalsAndHashcode() throws Exception { InstantConverter conv1 = new InstantConverter(); InstantConverter conv2 = new InstantConverter(); assertThat(conv2).isEqualTo(conv1); assertThat(conv2.hashCode()).isEqualTo(conv1.hashCode()); assertThat(conv1).isNotEqualTo(new IntegerConverter()); assertThat(conv1).isNotEqualTo(null); }
@Test public void testHashCode() { InstantConverter instance = new InstantConverter(); assertThat(instance.hashCode()).isEqualTo(InstantConverter.class.hashCode()); }