@Test
public void setEntity() {

    final UserInformation otherUserInformation = DefaultUserInformation.fromAuthorizationContext(
            AuthorizationContext.newInstance(DittoAuthorizationContextType.UNSPECIFIED,
                    AuthorizationSubject.newInstance(OTHER_SUBJECT)));
    final JsonValue expectedEntity = otherUserInformation.toJson();
    final WhoamiResponse originalResponse = WhoamiResponse.of(USER_INFORMATION, DITTO_HEADERS);
    final WhoamiResponse responseWithNewEntity = originalResponse.setEntity(expectedEntity);
    final JsonValue newEntity = responseWithNewEntity.getEntity(JsonSchemaVersion.LATEST);
    assertThat(newEntity).isEqualTo(expectedEntity);
}