void (int index, E e) { int size = mySize; checkOutOfBoundsForAdd(index, size); switch (size) { case 0: myElem = e; break; case 1: myElem = index == 0 ? new Object[]{e, myElem} : new Object[]{myElem, e}; break; default: Object[] array = resizeIfNecessary(size); System.arraycopy(array, index, array, index + 1, size - index); array[index] = e; break; } mySize++; modCount++; }