default List<Object> mapClaim(final String claimName,
                                  final RegisteredService registeredService,
                                  final Principal principal,
                                  final Object defaultValue) {
        val attribute = toMappedClaimName(claimName, registeredService);
        val attributeValues = principal.getAttributes().containsKey(attribute)
            ? principal.getAttributes().get(attribute)
            : defaultValue;

        LOGGER.trace("Handling claim [{}] with value(s) [{}]", attribute, attributeValues);
        return CollectionUtils.toCollection(attributeValues)
            .stream()
            .map(value -> {
                if (value instanceof Boolean) {
                    return value;
                }
                val valueContent = value.toString();
                if (valueContent.equalsIgnoreCase(Boolean.FALSE.toString())
                    || valueContent.equalsIgnoreCase(Boolean.TRUE.toString())) {
                    return BooleanUtils.toBoolean(valueContent);
                }
                return value;
            })
            .collect(Collectors.toList());
    }
Map claim and return values.

@param claimName         the claim name
@param registeredService the registered service
@param principal         the principal
@param defaultValue      the default value
@return the list of values
support/cas-server-support-oidc-core/src/main/java/org/apereo/cas/oidc/claims/OidcAttributeToScopeClaimMapper.java