public ValidationRuleResult apply() {

    logger.info("apply()=> BEGIN");
    if (getUserName() == null) {
      return null;
    }

    ValidationRuleResult result = new ValidationRuleResult();

    checkUnique(result);
    if (result.isFailed()) {
      return result;
    }

    logger.info("apply()=> END, SUCCESS");

    result.success();

    return result;
  }
  private void checkUnique(ValidationRuleResult result) {
    AllUserService allUserService = getAllUserService();

    AllUserData allUser = allUserService.findByUserName(getUserName());

    if (allUser != null) {
      if (getUserName().equals(allUser.getUserName())) {
        if (!allUser.getAllUserId().equals(getUserId())) {
          result.failed(
              ExceptionReason.UserUpdateReason.USER_MUST_BE_UNIQUE,
              new ObjectArgument<AllUserData>(allUser));
        }
      }
    }
  }