protected static List<String> getSupportedNameIdFormats(final SamlProfileBuilderContext context) {
        val supportedNameFormats = new ArrayList<>(context.getAdaptor().getSupportedNameIdFormats());
        LOGGER.debug("Metadata for [{}] declares the following NameIDs [{}]", context.getAdaptor().getEntityId(), supportedNameFormats);

        if (supportedNameFormats.isEmpty()) {
            supportedNameFormats.add(NameIDType.TRANSIENT);
            LOGGER.debug("No supported nameId formats could be determined from metadata. Added default [{}]", NameIDType.TRANSIENT);
        }
        if (StringUtils.isNotBlank(context.getRegisteredService().getRequiredNameIdFormat())) {
            val fmt = parseAndBuildRequiredNameIdFormat(context.getRegisteredService());
            supportedNameFormats.addFirst(fmt);
            LOGGER.debug("Added required nameId format [{}] based on saml service configuration for [{}]",
                fmt, context.getRegisteredService().getServiceId());
        }
        return supportedNameFormats;
    }
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