public Subject newSubject(final String identifier, final String confirmationMethod) {
        val confirmation = SamlUtils.newSamlObject(SubjectConfirmation.class);
        val method = SamlUtils.newSamlObject(ConfirmationMethod.class);
        method.setURI(confirmationMethod);
        confirmation.getConfirmationMethods().add(method);
        val nameIdentifier = SamlUtils.newSamlObject(NameIdentifier.class);
        nameIdentifier.setValue(identifier);
        val subject = SamlUtils.newSamlObject(Subject.class);
        subject.setNameIdentifier(nameIdentifier);
        subject.setSubjectConfirmation(confirmation);
        return subject;
    }
New subject element with given confirmation method.

@param identifier         the identifier
@param confirmationMethod the confirmation method
@return the subject
support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/Saml10ObjectBuilder.java