@Override
    public boolean supports(final Credential credential) {
        return credential.getCredentialMetadata()
            .getTrait(SurrogateCredentialTrait.class)
            .stream()
            .anyMatch(trait -> StringUtils.isNotBlank(trait.getSurrogateUsername()));
    }
This is {@link SurrogateAuthenticationMetaDataPopulator}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-surrogate-core/src/main/java/org/apereo/cas/authentication/SurrogateAuthenticationMetaDataPopulator.java