@Override
    protected AuthenticationHandlerExecutionResult authenticateUsernamePasswordInternal(
        final UsernamePasswordCredential credential, final String originalPassword) throws Throwable {

        val username = credential.getUsername();
        val password = credential.toPassword();

        val exception = this.usernameErrorMap.get(username);
        if (exception instanceof final GeneralSecurityException gse) {
            throw gse;
        }
        if (exception instanceof final PreventedException pe) {
            throw pe;
        }
        if (exception instanceof final RuntimeException re) {
            throw re;
        }
        if (exception != null) {
            LOGGER.debug("Cannot throw checked exception [{}] since it is not declared by method signature.",
                exception.getClass().getName(), exception);
        }

        if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)
            && (username.equals(password) || password.equals(StringUtils.reverse(username)))) {
            LOGGER.debug("User [{}] was successfully authenticated.", username);
            return new DefaultAuthenticationHandlerExecutionResult(this,
                credential, principalFactory.createPrincipal(username, this.userAttributes), this.warnings);
        }
        LOGGER.debug("User [{}] failed authentication", username);
        throw new FailedLoginException();
    }
Map of special usernames to exceptions that are raised when a user with that name attempts authentication.
core/cas-server-core-authentication-api/src/test/java/org/apereo/cas/authentication/handler/support/SimpleTestUsernamePasswordAuthenticationHandler.java