code: protected final void rangeCheck (int index, boolean insert)
      {
          if ((index < 0) || (insert ? (index > _size) : (index >= _size))) {
              throw new IndexOutOfBoundsException(
                  "Index: " + index + ", Size: " + _size);
          }
      }
docs: Check the range of a passed-in index to make sure it's valid.
  
  @param insert if true, an index equal to our size is valid.