### Question:
UserConverter implements ToServerConverter<ClientUser, User, ToServerConversionOptions>, ToClientConverter<User, ClientUser, ToClientConversionOptions> { @Override public ClientUser toClient(User user, ToClientConversionOptions options) { ClientUser clientUser = new ClientUser(); clientUser.setFullName(user.getFullName()); clientUser.setEmailAddress(user.getEmailAddress()); clientUser.setExternallyDefined(user.isExternallyDefined()); clientUser.setEnabled(user.isEnabled()); clientUser.setPreviousPasswordChangeTime(user.getPreviousPasswordChangeTime()); clientUser.setTenantId(user.getTenantId()); clientUser.setUsername(user.getUsername()); if (user.getRoles() != null){ Set<ClientRole> roleSet = new HashSet<ClientRole>(); @SuppressWarnings("unchecked") final Set<Role> roles = (Set<Role>) user.getRoles(); for (Role role: roles){ roleSet.add(roleConverter.toClient(role, null)); } clientUser.setRoleSet(roleSet); } return clientUser; }  @Override ClientUser toClient(User user, ToClientConversionOptions options); @Override User toServer(ClientUser clientObject, User user, ToServerConversionOptions options); @Override User toServer(ClientUser clientObject, ToServerConversionOptions options); @Override String getServerResourceType(); @Override String getClientResourceType();  }### Answer:
@Test public void testToClient() throws Exception { ClientUser converted = converter.toClient(server, ToClientConversionOptions.getDefault()); assertEquals(converted.getFullName(), server.getFullName()); assertEquals(converted.getEmailAddress(), server.getEmailAddress()); assertEquals(converted.getPreviousPasswordChangeTime(), server.getPreviousPasswordChangeTime()); assertEquals(converted.getTenantId(), server.getTenantId()); assertEquals(converted.getUsername(), server.getUsername()); assertEquals(converted.isEnabled(), (Boolean)server.isEnabled()); assertEquals(converted.isExternallyDefined(), (Boolean)server.isExternallyDefined()); assertTrue(converted.getRoleSet().contains(clientRole)); }