code: private void remove(int index) {
          int lastIndex = --size;
          Reference<E> removed = storage.array[index];
          Reference<E> lastElem = storage.array[lastIndex];
          storage.array[index] = lastElem;
          lastElem.index = index;
          removed.index = -1;
          storage.array[lastIndex] = null;
      }
docs: Removes an element by its index.