### Question:
UserPrincipalImpl implements UserPrincipal { public Boolean getCustomBooleanAttribute(String attributeName) { boolean attribute = false; JSONObject jwt = getRawIdentityToken(); if (customAttributeExists(attributeName)) { attribute = jwt.optBoolean(attributeName); } return attribute; } 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 testGetCustomBooleanAttributes() { assertEquals(true, userPrincipalImpl.getCustomBooleanAttribute("boolean")); assertEquals(false, userPrincipalImpl.getCustomBooleanAttribute("nonExistentCustomAttribute")); }