code: public Object get(int index) throws JSONException {
          try {
              Object value = values.get(index);
              if (value == null) {
                  throw new JSONException("Value at " + index + " is null.");
              }
              return value;
          } catch (IndexOutOfBoundsException e) {
              throw new JSONException("Index " + index + " out of range [0.." + values.size() + ")");
          }
      }
docs: Returns the value at {@code index}.
  
  @throws JSONException if this array has no value at {@code index}, or if
  that value is the {@code null} reference. This method returns
  normally if the value is {@code JSONObject#NULL}.