default <T extends Credential> Collection<T> getCredentialsOfType(final Class<T> type) {
        return getCredentials().stream().filter(type::isInstance).map(credential -> (T) credential).collect(Collectors.toList());
    }
Gets credentials of type.

@param <T>  the type parameter
@param type the type
@return the credentials of type
api/cas-server-core-api-authentication/src/main/java/org/apereo/cas/authentication/AuthenticationTransaction.java