protected List<Object> canonicalizeAttribute(final String key, final List<Object> value, final Map<String, CaseCanonicalizationMode> config) {
        if (value == null || value.isEmpty() || config == null || !config.containsKey(key)) {
            return value;
        }
        var canonicalizationMode = config.get(key);
        if (canonicalizationMode == null) {
            canonicalizationMode = defaultCaseCanonicalizationMode;
        }
        val canonicalizedValues = new ArrayList<>(value.size());
        for (val origValue : value) {
            if (origValue instanceof final String stringValue) {
                canonicalizedValues.add(canonicalizationMode.canonicalize(stringValue, Locale.ENGLISH));
            } else {
                canonicalizedValues.add(origValue);
            }
        }
        return canonicalizedValues;
    }
Canonicalize the attribute values if they are present in the config map.

@param key    attribute key
@param value  list of attribute values
@param config map of attribute names to canonicalization key for the attribute
@return if configured to do so, returns a canonicalized list of values.
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/attribute/AbstractQueryPersonAttributeDao.java