UserData { public String getFullName() { return String.format("%s %s", firstName, lastName); } UserData(User user, String firstName, String lastName, String email, String lob);  UserData(User user, String firstName, String lastName, String email, String lob, byte[] picture); String getFullName();  }
@Test public void getFullName() { var firstName = "First"; var lastName = "Last"; var expectedFullName = String.format("%s %s", firstName, lastName); var userData = new UserData() .setFirstName(firstName) .setLastName(lastName); var actualLastName = userData.getFullName(); assertThat(actualLastName).isEqualTo(expectedFullName); }