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