### Question:
RoleMapping extends DomainObject implements Comparable<RoleMapping> { public SortedSet<String> getPrivilegeNames() { return privileges.stream().map(Privilege::getName).collect(Collectors.toCollection(TreeSet::new)); }  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 testGetPrivilegesNames() { final Set<String> privilegeNames = mapping.getPrivilegeNames(); assertThat(privilegeNames.size(), is(2)); assertThat(privilegeNames, hasItem(privilege1.getName())); assertThat(privilegeNames, hasItem(privilege2.getName())); }