code: public static String validateLimit(int limit) {
          if (limit < 1) {
              // 0 is a valid, null value
              return "";
          }
  
          if (limit > LIMIT_MAX) {
              return String.valueOf(LIMIT_MAX);
          }
  
          return String.valueOf(limit);
      }
docs: Validate and convert the limit property
  
  @param limit
  @return