### Question:
RbacUserDetails implements UserDetails { @Override public String toString() { return "RbacUserDetails [username=" + getUsername() + ", authorities=" + getAuthorities() + "]"; } RbacUserDetails(final UserDetails delegate, final Set<GrantedAuthority> privileges); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override String getPassword(); @Override String getUsername(); @Override boolean isAccountNonExpired(); @Override boolean isAccountNonLocked(); @Override boolean isCredentialsNonExpired(); @Override boolean isEnabled(); UserDetails getDelegate(); @Override String toString();  }### Answer:
@Test public void testToString() { final String string = userDetails.toString(); assertThat(string, containsString(USERNAME)); assertThat(string, containsString(PRIVILEGE)); }