public static Optional<SamlRegisteredServiceMetadataAdaptor> get(
        final SamlRegisteredServiceCachingMetadataResolver resolver,
        final SamlRegisteredService registeredService,
        final String entityID) {
        return Optional.ofNullable(entityID)
            .map(id -> {
                val criteria = new CriteriaSet(new EntityIdCriterion(id),
                    new EntityRoleCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME));
                return get(resolver, registeredService, entityID, criteria);
            }).orElseGet(Optional::empty);
    }
Adapt saml metadata and parse. Acts as a facade.

@param resolver          the resolver
@param registeredService the service
@param entityID          the entity id
@return the saml metadata adaptor
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/SamlRegisteredServiceMetadataAdaptor.java