protected String getPrincipalAttributeValue(final Principal principal, final String attributeName) {
        val values = getPrincipalAttributeValues(principal, attributeName);
        if (values.isEmpty()) {
            return null;
        }
        return StringUtils.defaultIfBlank(values.iterator().next().toString(), null);
    }
This is {@link DefaultScimPrincipalAttributeMapper}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-scim-core/src/main/java/org/apereo/cas/scim/v2/provisioning/DefaultScimPrincipalAttributeMapper.java