Email { @Override public int hashCode() { return Objects.hash(address, verified, verificationToken); } @JsonCreator  Email(@JsonProperty("address") String address,
               @JsonProperty("verified") boolean verified,
               @JsonProperty("verificationToken") String verificationToken); String getAddress(); String getVerificationToken(); boolean isVerified(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test void hashCodeShouldBeConsistent() { Email emailOne = new Email("test@test.com", true, "token"); Email emailTwo = new Email("test@test.com", true, "token"); assertEquals(emailOne.hashCode(), emailTwo.hashCode()); }
@Test void hashCodeShouldNotCollide() { Email emailOne = new Email("test@test.com", true, "token"); Email emailTwo = new Email("differentTest@test.com", true, "token"); assertNotEquals(emailOne.hashCode(), emailTwo.hashCode()); }