code: public List<T> pollAll() {
      List<T> retList = new ArrayList<T>(size);
      for (int i = 0; i < entries.length; i++) {
        LinkedElement<T> current = entries[i];
        while (current != null) {
          retList.add(current.element);
          current = current.next;
        }
      }
      this.clear();
      return retList;
    }
docs: Remove all elements from the set and return them. Clear the entries.