code: public void clear() {
      modCount++;
  
      // Let gc do its work
      for (int i = 0; i < size; i++)
        data[i] = null;
  
      size = 0;
    }
docs: Removes all of the elements from this list.  The list will
  be empty after this call returns.