code: @Override
      public T remove(int index) {
          /* Cache the value at the indicated position; this also does the bounds
           * check.
           */
          T result = get(index);
  
          /* Use a naive shuffle-down algorithm to reposition elements after
           * the removed one.
           */
          for (int i = index + 1; i < size(); ++i)
              set(i - 1, get(i));
  
          /* Clobber the last element to play nicely with the garbage collector. */
          set(size() - 1, null);
  
          /* Decrement our size. */
          --mSize;
  
          /* If we are now at 1/8 total capacity, shrink the structure. */
          if (size() * 8 <= mArrays.length * mArrays.length)
              shrink();
              /* Otherwise, if the size is now an even multiple of the array size,
               * we can drop the very last array.  This is the array whose offset
               * is one after the end of the elements.
               */
          else if (size() % mArrays.length == 0)
              mArrays[computeOffset(size())] = null;
  
          return result;
      }
docs: Removes the element at the specified position from the HashedArrayTree.
  
  @param index The index of the element to remove.
  @return The value of the element at that position.
  @throws IndexOutOfBoundsException If the index is invalid.