code: public IntArrayList set(int index, int val) {
          if (index < 0 || index >= size) {
              throw new IndexOutOfBoundsException(String.valueOf(index));
          }
          data[index] = val;
          return this;
      }
docs: Replaces the value at the specified position in this list with the
  specified value.
  
  @param index index of the value to replace
  @param val value to be stored at the specified position
  @throws IndexOutOfBoundsException if the index is out of range (index &lt; 0 || index &ge; size())