code: public void add(int index, E element) {
      if (index > size || index < 0)
        throw new IndexOutOfBoundsException(
            "Index: " + index + ", Size: " + size);
  
      ensureCapacity(size + 1);  // Increments modCount!!
      System.arraycopy(data, index, data, index + 1,
          size - index);
      data[index] = element;
      size++;
    }
docs: Inserts the specified element at the specified position in this
  list. Shifts the element currently at that position (if any) and
  any subsequent elements to the right (adds one to their indices).
  
  @param index   index at which the specified element is to be inserted
  @param element element to be inserted
  @throws IndexOutOfBoundsException {@inheritDoc}