public void buildMetadataResolverAggregate(final String entityId) {
        LOGGER.trace("Building metadata resolver aggregate");
        this.metadataResolver = new ChainingMetadataResolver();
        val entries = this.metadataResources.entrySet();
        val resolvers = new ArrayList<MetadataResolver>(entries.size());
        entries.forEach(entry -> {
            val resource = entry.getKey();
            LOGGER.debug("Loading [{}]", resource.getFilename());
            resolvers.addAll(loadMetadataFromResource(entry.getValue(), resource, entityId));
        });
        FunctionUtils.doUnchecked(__ -> {
            this.metadataResolver.setId(ChainingMetadataResolver.class.getCanonicalName());
            this.metadataResolver.setResolvers(resolvers);
            LOGGER.debug("Collected metadata from [{}] resolvers(s). Initializing aggregate resolver...", resolvers.size());
            this.metadataResolver.initialize();
            LOGGER.info("Metadata aggregate initialized successfully.");
        });
    }
Build metadata resolver aggregate. Loops through metadata resources
and attempts to resolve the metadata.

@param entityId the entity id
support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/AbstractMetadataResolverAdapter.java