### Question:
UserPrincipalImpl implements UserPrincipal { @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("["); final Iterator<UserRole> iterator = roles.iterator(); if (iterator.hasNext()) { sb.append(iterator.next().getName()); while (iterator.hasNext()) { sb.append(", ").append(iterator.next().getName()); } } sb.append("]"); return "UserPrincipalImpl{" + "username='" + username + '\'' + ", firstName=" + firstName + '\'' + ", lastName=" + lastName + '\'' + ", email='" + email + '\'' + ", roles=" + sb.toString() + '}'; } protected  UserPrincipalImpl(final String username, final String firstName,
                    final String lastName, final String email, final Set<UserRole> roles,
                    final String identityToken, final String accessToken,
                    final String refreshToken); @Override boolean hasResourceRole(final String role, final String resourceId); @Override boolean hasRealmRole(final String role); @Override String getUsername(); @Override String getFirstName(); @Override String getLastName(); @Override String getName(); @Override Set<UserRole> getRoles(); @Override Set<UserRole> getRealmRoles(); @Override Set<UserRole> getResourceRoles(); @Override String getEmail(); static Builder newUser(); @Override String toString(); @Override String getIdentityToken(); @Override String getAccessToken(); @Override String getRefreshToken(); String getCustomStringAttribute(String attributeName); Boolean getCustomBooleanAttribute(String attributeName); Long getCustomLongAttribute(String attributeName); Integer getCustomIntegerAttribute(String attributeName);  }### Answer:
@Test public void testToStringImpl() { Assert.assertTrue(userPrincipalImpl.toString().contains("cRole")); Assert.assertTrue(userPrincipalImpl.toString().contains("rRole")); }