AdminUser extends Immutable { @Override public String toString() { return "AdminUser [userName=" + userName + ", userId=" + userId + ", administratorId=" + administratorId + ", firstname=" + firstname + ", surname=" + surname + "]"; } AdminUser(String userName, int userId, int administratorId, String firstname, String surname); String getUserName(); int getUserId(); int getAdministratorId(); String getFirstname(); String getSurname(); @Override String toString();  }
@Test public void testToString() { AdminUser user = new AdminUser("jad", 1, 1, "Jane", "Doe"); assertEquals("AdminUser [userName=jad, userId=1, administratorId=1, firstname=Jane, surname=Doe]", user.toString()); AdminUser userWithNullStrings = new AdminUser(null, 1, 1, null, null); assertEquals("AdminUser [userName=null, userId=1, administratorId=1, firstname=null, surname=null]", userWithNullStrings.toString()); }