protected Optional<GoogleAuthenticatorAccount> getAuthorizedAccountForToken(
        final GoogleAuthenticatorTokenCredential tokenCredential,
        final Collection<? extends OneTimeTokenAccount> accounts) {
        val otp = Integer.parseInt(tokenCredential.getToken());
        return accounts
            .stream()
            .filter(ac -> isCredentialAssignedToAccount(tokenCredential, ac) && isTokenAuthorizedFor(otp, ac))
            .map(GoogleAuthenticatorAccount.class::cast)
            .findFirst();
    }
This is {@link GoogleAuthenticatorOneTimeTokenCredentialValidator}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-gauth-core/src/main/java/org/apereo/cas/gauth/credential/GoogleAuthenticatorOneTimeTokenCredentialValidator.java