private static Collection<NameIDFormat> buildNameIdFormatElements(Collection<String> nameIds) {
        final SAMLObjectBuilder<NameIDFormat> builder = builder(NameIDFormat.DEFAULT_ELEMENT_NAME);
        final Collection<NameIDFormat> formats = new ArrayList<>();
        for (final String value : nameIds) {
            final NameIDFormat nameIdFormat = builder.buildObject();
            nameIdFormat.setFormat(value);
            formats.add(nameIdFormat);
        }
        return formats;
    }
A service which returns the SAML metadata in response to a user request.
saml/src/main/java/com/linecorp/armeria/server/saml/SamlMetadataServiceFunction.java