code: public PasswordCheckResult check(boolean isAdminitrative, String userName, String password) {
          // TODO: allow custom restrictions?
          List<PasswordRestriction> passwordValuesRestrictions = getPasswordRestrictions();
          final PasswordStrengthCheckResult strengthResult = this.passwordStrengthChecker.check(userName, password, passwordValuesRestrictions);
  
          final int failedRestrictions = strengthResult.getRestrictionFailures().size();
          final PasswordStrength strength = strengthResult.getStrength();
          final boolean strongEnough = assertStrength(strength);
  
          PasswordCheckResult.Result resultAction;
          String resultMessage = null;
          if (isAdminitrative) {
              if (strongEnough) {
                  if (failedRestrictions > 0) {
                      resultAction = Result.WARN;
                      resultMessage = strengthResult.getRestrictionFailures().get(0).getMessage();
                  } else {
                      resultAction = Result.ACCEPT;
                  }
              } else {
                  resultAction = Result.WARN;
                  resultMessage = ROOT_LOGGER.passwordNotStrongEnough(strength.toString(), this.acceptable.toString());
              }
          } else {
              if (strongEnough) {
                  if (failedRestrictions > 0) {
                      resultAction = Result.REJECT;
                      resultMessage = strengthResult.getRestrictionFailures().get(0).getMessage();
                  } else {
                      resultAction = Result.ACCEPT;
                  }
              } else {
                  if (failedRestrictions > 0) {
                      resultAction = Result.REJECT;
                      resultMessage = strengthResult.getRestrictionFailures().get(0).getMessage();
                  } else {
                      resultAction = Result.REJECT;
                      resultMessage = ROOT_LOGGER.passwordNotStrongEnough(strength.toString(), this.acceptable.toString());
                  }
              }
          }
  
          return new PasswordCheckResult(resultAction, resultMessage);
  
      }
docs: Method which performs strength checks on password. It returns outcome which can be used by CLI.
  
  @param isAdminitrative - administrative checks are less restrictive. This means that weak password or one which violates restrictions is not indicated as failure.
  Administrative checks are usually performed by admin changing/setting default password for user.
  @param userName - the name of user for which password is set.
  @param password - password.
  @return