@Override
    public AuthenticationTransaction newTransaction(final Service service, final Credential... credentials) {
        val credentialSet = sanitizeCredentials(credentials);
        val registeredService = servicesManager.findServiceBy(service);
        return new DefaultAuthenticationTransaction(service, registeredService, credentialSet);
    }
Sanitize credentials set. It's important to keep the order of
the credentials in the final set as they were presented.

@param credentials the credentials
@return the set
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/DefaultAuthenticationTransactionFactory.java