### Question:
RoleMapping extends DomainObject implements Comparable<RoleMapping> { public void setPrivileges(final SortedSet<Privilege> privileges) { requireNonNull(privileges, "privileges must not be null"); this.privileges = 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 testSetPrivileges() { final SortedSet<Privilege> privileges = new TreeSet<>(); mapping.setPrivileges(privileges); assertThat(mapping.getPrivileges(), is(privileges)); }
@Test(expected = NullPointerException.class) public void testSetPrivilegesNull() { mapping.setPrivileges(null); fail(); }