private static long countResolvableEntityDescriptors(final MetadataResolutionResult result) {
        return FunctionUtils.doUnchecked(() -> {
            val criteria = new EvaluableEntityRoleEntityDescriptorCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
            return Iterables.size(result.getResult().getMetadataResolver().resolve(new CriteriaSet(criteria)));
        });
    }
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