UserMapper { public static UserModel transform(UserEntity userEntity) { UserModel userModel = null; if (userEntity != null) { userModel = new UserModel(userEntity.getUsername()); userModel.setEmail(userEntity.getEmail()); userModel.setUid(userEntity.getUid()); } return userModel; }  static UserModel transform(UserEntity userEntity); static UserEntity transform(AuthResult authResult);  }
@Test public void testTransformUserEntity() { UserEntity userEntity = createUserEntity(); UserModel userModel = UserMapper.transform(userEntity); assertThat(userModel, is(instanceOf(UserModel.class))); assertThat(userModel.getEmail(), is(FAKE_USER_USERNAME)); assertThat(userModel.getUid(), is(FAKE_USER_UID)); assertThat(userModel.getUsername(), is(FAKE_USER_USERNAME)); }