code: public List<T> pollN(int n) {
      if (n >= size) {
        return pollAll();
      }
      List<T> retList = new ArrayList<T>(n);
      if (n == 0) {
        return retList;
      }
      boolean done = false;
      int currentBucketIndex = 0;
  
      while (!done) {
        LinkedElement<T> current = entries[currentBucketIndex];
        while (current != null) {
          retList.add(current.element);
          current = current.next;
          entries[currentBucketIndex] = current;
          size--;
          modification++;
          if (--n == 0) {
            done = true;
            break;
          }
        }
        currentBucketIndex++;
      }
      shrinkIfNecessary();
      return retList;
    }
docs: Remove and return first n elements on the linked list of all elements.
  
  @return first element