### Question:
User { @Override public int hashCode(){ return Objects.hash(id, name, email, userId); } User();  User(String userId, String name, String email); @Id @GeneratedValue Long getId(); User setId(Long id); String getName(); User setName(String name); String getEmail(); User setEmail(String email); String getUserId(); User setUserId(String userId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testHashCode(){ String userId = "dudes"; String userName = "The Dude"; String userEmail = "TheDude@email.com"; User user1 = new User() .setId(1L) .setUserId(userId) .setName(userName) .setEmail(userEmail); User user2 = new User() .setId(2L) .setUserId(userId) .setName(userName) .setEmail(userEmail); Assert.assertNotEquals(user1.hashCode(), user2.hashCode()); }