code: public final void removeAll() {
          Iterator<T> it = iterator();
          while (it.hasNext()) {
              it.next();
              it.remove();
          }
      }
docs: Removes all elements by repeatedly calling this sequence's Iterator.remove().