@Test
public void removesDuplicatedAuthSubjectsFromJsonRepresentation() {

    final String withDups = AUTH_CONTEXT.toJsonString();
    final JsonObject expected = JsonFactory.newObjectBuilder()
            .set(DittoHeaderDefinition.AUTHORIZATION_CONTEXT.getKey(), AUTH_CONTEXT_WITHOUT_DUPLICATES.toJson())
            .build();
    final Map<String, String> headersWithDuplicatedAuthSubjects = new HashMap<>();
    headersWithDuplicatedAuthSubjects.put(DittoHeaderDefinition.AUTHORIZATION_CONTEXT.getKey(), withDups);
    final ImmutableDittoHeaders dittoHeaders = ImmutableDittoHeaders.of(headersWithDuplicatedAuthSubjects);
    assertThat(dittoHeaders.toJson()).isEqualTo(expected);
}