docs: private int pruneHeadTasks(Predicate<ReceiveMessageBatchTask> pruneCondition) {
          int numberPruned = 0;
          while (!finishedTasks.isEmpty()) {
              if (pruneCondition.test(finishedTasks.getFirst())) {
                  finishedTasks.removeFirst();
                  numberPruned++;
              } else {
                  break;
              }
          }
          return numberPruned;
      }