### Question:
RoleMapping extends DomainObject implements Comparable<RoleMapping> { public SortedSet<Privilege> getPrivileges() { return Collections.unmodifiableSortedSet(privileges); }  Role getRole(); String getRoleName(); void setRole(final Role role); SortedSet<Privilege> getPrivileges(); SortedSet<String> getPrivilegeNames(); void setPrivileges(final SortedSet<Privilege> privileges); @Override String toString(); @Override int compareTo(final RoleMapping other);  }### Answer:
@Test public void testGetPrivileges() { final Set<Privilege> privileges = mapping.getPrivileges(); assertThat(privileges.size(), is(2)); assertThat(privileges, hasItem(privilege1)); assertThat(privileges, hasItem(privilege2)); }
@Test(expected = UnsupportedOperationException.class) public void testGetPrivilegesImmutable() { mapping.getPrivileges().add(privilege1); fail(); }