private void verifyAccountStateOrThrow(final Account account,
                                           final String stateType,
                                           final String authType,
                                           final BooleanSupplier isValidStateSupplier) {
        if (!isValidStateSupplier.getAsBoolean()) {
            LOGGER.warn("User account '{}' attempted {} authentication with the account in a {} state. {}",
                    account.getUserId(), authType, stateType, account);
            throw new BadRequestException(
                    account.getUserId(),
                    AuthenticateOutcomeReason.ACCOUNT_LOCKED,
                    LogUtil.message("User account '{}' is {}.", account.getUserId(), stateType));
        }
    }
@param account              The user account to check
@param isValidStateSupplier Should return true for a valid state.
@throws BadRequestException if user is in an invalid state
stroom-security/stroom-security-identity/src/main/java/stroom/security/identity/authenticate/AuthenticationServiceImpl.java