@Test
public void setSubjectsForWorks() {

    final Policy policy = createPolicy();
    final Subject NEW_SUBJECT_1 =
            Subject.newInstance(SubjectIssuer.GOOGLE, "newSubject1");
    final Subject NEW_SUBJECT_2 =
            Subject.newInstance(SubjectIssuer.GOOGLE, "newSubject2");
    final Subjects NEW_SUBJECTS = Subjects.newInstance(NEW_SUBJECT_1, NEW_SUBJECT_2);
    final Policy policyModified = policy.setSubjectsFor(END_USER_LABEL, NEW_SUBJECTS);
    assertThat(policy).hasLabel(END_USER_LABEL);
    assertThat(policy).hasSubjectFor(END_USER_LABEL, END_USER_SUBJECT_ID_1);
    assertThat(policy).hasSubjectTypeFor(END_USER_LABEL, END_USER_SUBJECT_ID_1, END_USER_SUBJECT_TYPE_1);
    assertThat(policy).doesNotHaveSubjectFor(END_USER_LABEL, NEW_SUBJECT_1.getId());
    assertThat(policy).doesNotHaveSubjectFor(END_USER_LABEL, NEW_SUBJECT_2.getId());
    assertThat(policy).hasResourceFor(END_USER_LABEL, TestConstants.Policy.RESOURCE_TYPE, END_USER_RESOURCE_1);
    assertThat(policyModified).hasLabel(END_USER_LABEL);
    assertThat(policyModified).doesNotHaveSubjectFor(END_USER_LABEL, END_USER_SUBJECT_ID_1);
    assertThat(policyModified).hasSubjectFor(END_USER_LABEL, NEW_SUBJECT_1.getId());
    assertThat(policyModified).hasSubjectFor(END_USER_LABEL, NEW_SUBJECT_2.getId());
    assertThat(policyModified).hasResourceFor(END_USER_LABEL, TestConstants.Policy.RESOURCE_TYPE,
            END_USER_RESOURCE_1);
}