@Audit(
        action = AuditableActions.SAML2_RESPONSE,
        actionResolverName = AuditActionResolvers.SAML2_RESPONSE_ACTION_RESOLVER,
        resourceResolverName = AuditResourceResolvers.SAML2_RESPONSE_RESOURCE_RESOLVER)
    @Override
    public T build(final SamlProfileBuilderContext context) throws Exception {
        val assertion = context.getAuthenticatedAssertion().isPresent()
            ? Optional.of(buildSamlAssertion(context))
            : Optional.<Assertion>empty();
        val finalResponse = buildResponse(assertion, context);
        return encodeFinalResponse(context, finalResponse);
    }
The {@link BaseSamlProfileSamlResponseBuilder} is responsible for
building the final SAML assertion for the relying party.

@author Misagh Moayyed
@since 4.2
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/response/BaseSamlProfileSamlResponseBuilder.java