// complex scenarios
@Test
public final void whenScenarioOfWorkingWithAssociations_thenTheChangesAreCorrectlyPersisted() {
final Privilege existingAssociation = getAssociationAPI().create(getAssociationEntityOps().createNewEntity());
final Role resource1 = new Role(randomAlphabetic(6), Sets.newHashSet(existingAssociation));
final Role resource1ViewOfServerBefore = getApi().create(resource1);
assertThat(resource1ViewOfServerBefore.getPrivileges(), hasItem(existingAssociation));
final Role resource2 = new Role(randomAlphabetic(6), Sets.newHashSet(existingAssociation));
getApi().create(resource2);
final Role resource1ViewOfServerAfter = getApi().findOne(resource1ViewOfServerBefore.getId());
assertThat(resource1ViewOfServerAfter.getPrivileges(), hasItem(existingAssociation));
}