protected MetadataResolutionResult isMetadataResolverAcceptable(
        final MetadataResolverCacheQueryResult queryResult,
        final CriteriaSet criteriaSet) {
        if (criteriaSet.contains(SatisfyAnyCriterion.class)) {
            return MetadataResolutionResult.builder()
                .entityDescriptor(Optional.empty())
                .valid(true)
                .build();
        }
        val entityDescriptor = queryResult.getEntityDescriptor()
            .orElseGet(Unchecked.supplier(() -> queryResult.getResult().getMetadataResolver().resolveSingle(criteriaSet)));

        return MetadataResolutionResult
            .builder()
            .valid(entityDescriptor != null && entityDescriptor.isValid())
            .entityDescriptor(Optional.ofNullable(entityDescriptor))
            .result(queryResult.getResult())
            .build();
    }
An adaptation of metadata resolver which handles the resolution of metadata resources
inside a cache. It basically is a fancy wrapper around a cache, and constructs the cache
semantics before processing the resolution of metadata for a SAML service.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/SamlRegisteredServiceDefaultCachingMetadataResolver.java