code: private int getNonNegativeInt(String s) {
          int i;
  
          try {
              i = Integer.parseInt(s);
          } catch (NumberFormatException e) {
              throw new IllegalArgumentException("Unable to handle non-numeric value " + s);
          }
  
          if (i < 0) {
              throw new IllegalArgumentException(s + " is an invalid index value");
          }
  
          return i;
      }
docs: -------------------------------------------------------------