@Override
    public Map<String, List<Object>> filter(final Map<String, List<Object>> givenAttributes) {
        val attributesToRelease = new HashMap<String, List<Object>>();
        givenAttributes.entrySet().stream().filter(filterProvidedGivenAttributes()).forEach(entry -> {
            val attributeName = entry.getKey();
            if (getPatterns().containsKey(attributeName)) {
                val attributeValues = CollectionUtils.toCollection(entry.getValue());
                LOGGER.trace("Found attribute [{}] in pattern definitions with value(s) [{}]", attributeName, attributeValues);
                val patterns = createPatternsAndReturnValue(attributeName);
                var finalValues = patterns
                    .stream()
                    .map(patternDefinition -> {
                        val pattern = patternDefinition.getLeft();
                        LOGGER.trace("Found attribute [{}] in the pattern definitions. Processing pattern [{}]", attributeName, pattern.pattern());
                        var filteredValues = filterAndMapAttributeValuesByPattern(attributeValues, pattern, patternDefinition.getValue());
                        LOGGER.debug("Filtered attribute values for [{}] are [{}]", attributeName, filteredValues);
                        return filteredValues;
                    })
                    .flatMap(Collection::stream)
                    .collect(Collectors.toList());
                if (finalValues.isEmpty()) {
                    LOGGER.trace("Attribute [{}] has no values remaining and shall be excluded", attributeName);
                } else {
                    collectAttributeWithFilteredValues(attributesToRelease, attributeName, finalValues);
                }
            } else {
                handleUnmappedAttribute(attributesToRelease, entry.getKey(), entry.getValue());
            }
        });
        LOGGER.debug("Received [{}] attributes. Filtered and released [{}]", givenAttributes.size(), attributesToRelease.size());
        return attributesToRelease;
    }
This is {@link RegisteredServiceMutantRegexAttributeFilter}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/support/RegisteredServiceMutantRegexAttributeFilter.java