protected NameID buildNameId(final SamlProfileBuilderContext context) throws SamlException {
        val supportedNameFormats = getSupportedNameIdFormats(context);
        val requiredNameFormat = getRequiredNameIdFormatIfAny(context);
        validateRequiredNameIdFormatIfAny(supportedNameFormats, requiredNameFormat, context);
        val nameID = determineNameId(supportedNameFormats, context);
        return finalizeNameId(nameID, context);
    }
This is {@link SamlProfileSamlNameIdBuilder}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/nameid/SamlProfileSamlNameIdBuilder.java