### Question:
RoleMapping extends DomainObject implements Comparable<RoleMapping> { @Override public String toString() { return "RoleMapping [role=" + role + ", 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 testToString() { final String result = mapping.toString(); assertThat(result, containsString(role.getName())); assertThat(result, containsString(privilege1.getName())); assertThat(result, containsString(privilege2.getName())); }