public static Collection<AuthenticationPolicy> newAuthenticationPolicy(final AuthenticationPolicyProperties policyProps) {
        if (policyProps.getReq().isEnabled()) {
            val requiredHandlerNames = org.springframework.util.StringUtils.commaDelimitedListToSet(policyProps.getReq().getHandlerName());
            val policy = new RequiredAuthenticationHandlerAuthenticationPolicy(requiredHandlerNames, policyProps.getReq().isTryAll());
            return CollectionUtils.wrapList(configureAuthenticationPolicy(policy, policyProps.getReq()));
        }

        if (policyProps.getRequiredAttributes().isEnabled()) {
            val policy = new RequiredAttributesAuthenticationPolicy(policyProps.getRequiredAttributes().getAttributes());
            return CollectionUtils.wrapList(configureAuthenticationPolicy(policy, policyProps.getRequiredAttributes()));
        }

        if (policyProps.getAllHandlers().isEnabled()) {
            val policy = new AllAuthenticationHandlersSucceededAuthenticationPolicy();
            return CollectionUtils.wrapList(configureAuthenticationPolicy(policy, policyProps.getAllHandlers()));
        }

        if (policyProps.getAll().isEnabled()) {
            val policy = new AllCredentialsValidatedAuthenticationPolicy();
            return CollectionUtils.wrapList(configureAuthenticationPolicy(policy, policyProps.getAll()));
        }

        if (policyProps.getNotPrevented().isEnabled()) {
            val policy = new NotPreventedAuthenticationPolicy();
            return CollectionUtils.wrapList(configureAuthenticationPolicy(policy, policyProps.getNotPrevented()));
        }

        if (!policyProps.getGroovy().isEmpty() && CasRuntimeHintsRegistrar.notInNativeImage()) {
            return policyProps
                .getGroovy()
                .stream()
                .map(groovy -> {
                    val policy = new GroovyScriptAuthenticationPolicy(groovy.getScript());
                    return configureAuthenticationPolicy(policy, groovy);
                })
                .collect(Collectors.toList());
        }

        if (!policyProps.getRest().isEmpty()) {
            return policyProps
                .getRest()
                .stream()
                .map(RestfulAuthenticationPolicy::new)
                .collect(Collectors.toList());
        }

        if (policyProps.getAny().isEnabled()) {
            val policy = new AtLeastOneCredentialValidatedAuthenticationPolicy(policyProps.getAny().isTryAll());
            return CollectionUtils.wrapList(configureAuthenticationPolicy(policy, policyProps.getAny()));
        }
        return new ArrayList<>();
    }
New authentication policy collection.

@param policyProps the policy props
@return the collection
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/CoreAuthenticationUtils.java