protected MessageHandler buildSAMLMetadataLookupHandler(final SAML2MetadataResolver metadataResolver)
        throws ComponentInitializationException {
        val roleResolver = new PredicateRoleDescriptorResolver(metadataResolver.resolve());
        roleResolver.initialize();

        val metadataLookupHandler = new SAMLMetadataLookupHandler();
        metadataLookupHandler.setRoleDescriptorResolver(roleResolver);
        metadataLookupHandler.initialize();
        return metadataLookupHandler;
    }
<p>buildSAMLMetadataLookupHandler.</p>

@param metadataResolver a {@link SAML2MetadataResolver} object
@return a {@link MessageHandler} object
@throws ComponentInitializationException if any.
pac4j-saml/src/main/java/org/pac4j/saml/sso/artifact/DefaultSOAPPipelineFactory.java