public void add(int index, E element) {
        if (index > size || index < 0)
            throw new IndexOutOfBoundsException(outOfBoundsMsg(index));

        ensureCapacityInternal(size + 1);  // Increments modCount!!
        System.arraycopy(elementData, index, elementData, index + 1,
                         size - index);
        elementData[index] = element;
        size++;
    }
public void add ( int index , E element ) { if ( index > size || index < 0 ) throw new IndexOutOfBoundsException ( outOfBoundsMsg ( index ) ) ; ensureCapacityInternal ( size + 1 ) ; System . arraycopy ( elementData , index , elementData , index + 1 , size - index ) ; elementData [ index ] = element ; size ++ ; }
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}