### Question:
User { @Override public String toString(){ return MoreObjects.toStringHelper(this) .add("ID", id) .add("User ID", userId) .add("Name", name) .add("Email", email) .toString(); } 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 testToString(){ String userId = "dudes"; String userName = "The Dude"; String userEmail = "TheDude@email.com"; User user = new User() .setId(1L) .setUserId(userId) .setName(userName) .setEmail(userEmail); String exp = MoreObjects.toStringHelper(User.class) .add("ID", 1L) .add("User ID", userId) .add("Name", userName) .add("Email", userEmail) .toString(); Assert.assertEquals("Testing toString()", exp, user.toString()); }