public PipelineBuilder<I, List<T>> inBatches(
      final int maximumBatchSize, final Function<List<T>, Integer> stopBatchCondition) {
    return new PipelineBuilder<>(
        inputPipe,
        stages,
        pipes,
        lastStageName,
        new BatchingReadPipe<>(
            pipeEnd,
            maximumBatchSize,
            outputCounter.labels(lastStageName + "_outputPipe", "batches"),
            stopBatchCondition),
        (int) Math.ceil(((double) bufferSize) / maximumBatchSize),
        outputCounter,
        tracingEnabled,
        pipelineName);
  }
Batches items into groups of at most <i>maximumBatchSize</i>. Batches are created eagerly to
minimize delay so may not be full.

<p>Order of items is preserved.

<p>The output buffer size is reduced to <code>bufferSize / maximumBatchSize + 1</code>.

@param maximumBatchSize the maximum number of items to include in a batch.
@param stopBatchCondition the condition before ending the batch
@return a {@link PipelineBuilder} ready to extend the pipeline with additional stages.
services/pipeline/src/main/java/org/hyperledger/besu/services/pipeline/PipelineBuilder.java