code: @Override
      public int drainTo(Collection<DelayedEntry> collection) {
          checkNotNull(collection, "collection can not be null");
  
          Iterator<DelayedEntry> iterator = deque.iterator();
          while (iterator.hasNext()) {
              DelayedEntry e = iterator.next();
              collection.add(e);
              iterator.remove();
          }
          resetCountIndex();
          return collection.size();
      }
docs: Removes all available elements from this queue and adds them
  to the given collection.
  
  @param collection all elements to be added to this collection.
  @return number of removed items from this queue.