public static List<SAMLAttribute> from(final AttributeConverter samlAttributeConverter, final Iterable<Attribute> samlAttributes) {

            List<SAMLAttribute> attributes = new ArrayList<>();

            samlAttributes.forEach(attribute -> {
                val result = samlAttributeConverter.convert(attribute);
                if (result instanceof Collection) {
                    attributes.addAll((Collection<? extends SAMLAttribute>) result);
                } else {
                    attributes.add((SAMLAttribute) result);
                }
            });

            return attributes;
        }
<p>Constructor for SAML2AuthenticationCredentials.</p>

@param nameId a {@link SAML2AuthenticationCredentials.SAMLNameID} object
@param issuerId a {@link String} object
@param samlAttributes a {@link List} object
@param conditions a {@link Conditions} object
@param sessionIndex a {@link String} object
@param authnContexts a {@link List} object
@param authnContextAuthorities a {@link List} object
@param inResponseTo a {@link String} object
pac4j-saml/src/main/java/org/pac4j/saml/credentials/SAML2AuthenticationCredentials.java