docs: public void clear() {
          boolean done = false;
          while (!done) {
              ReceiveMessageBatchTask currentBatch = null;
              synchronized (finishedTasks) {
                  currentBatch = finishedTasks.poll();
              }
  
              if (currentBatch != null) {
                  currentBatch.clear();
              } else {
                  // ran out of batches to clear
                  done = true;
              }
          }
      }