protected boolean requiredAttributeFound(final String attributeName,
                                             final RegisteredServiceAccessStrategyRequest request,
                                             final Map<String, Set<String>> requiredAttributes) throws Throwable {
        val requiredValues = requiredAttributes.get(attributeName);
        val availableValues = CollectionUtils.toCollection(request.getAttributes().get(attributeName));

        val scriptFactoryInstance = ExecutableCompiledScriptFactory.findExecutableCompiledScriptFactory();
        
        val results = new ArrayList<>();
        for (val requiredValue : requiredValues) {
            if (scriptFactoryInstance.isPresent() && scriptFactoryInstance.get().isInlineScript(requiredValue) && CasRuntimeHintsRegistrar.notInNativeImage()) {
                val script = scriptFactoryInstance.get().getInlineScript(requiredValue).orElseThrow();
                try (val executableScript = scriptFactoryInstance.get().fromScript(script)) {
                    val args = CollectionUtils.<String, Object>wrap(
                        "principalId", request.getPrincipalId(),
                        "currentValues", availableValues,
                        "attributes", request.getAttributes(),
                        "logger", LOGGER);
                    executableScript.setBinding(args);
                    results.add(executableScript.execute(args.values().toArray(), Boolean.class));
                }
            } else {
                val pattern = RegexUtils.createPattern(requiredValue, caseInsensitive ? Pattern.CASE_INSENSITIVE : 0);
                LOGGER.debug("Checking [{}] against [{}] with pattern [{}] for attribute [{}]",
                    requiredValues, availableValues, pattern, attributeName);
                if (pattern.equals(RegexUtils.MATCH_NOTHING_PATTERN)) {
                    results.add(availableValues.stream().anyMatch(requiredValues::contains));
                } else {
                    results.add(availableValues.stream().map(Object::toString).anyMatch(pattern.asPredicate()));
                }
            }
        }
        return results.contains(true);
    }
Enough required attributes available to process? Check collection sizes and determine
if we have enough data to move on.

@param principalAttributes the principal attributes
@param requiredAttributes  the required attributes
@return true /false
core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/util/RegisteredServiceAccessStrategyEvaluator.java