@Override
  public int drainTo(final Collection<List<T>> output, final int maxElements) {
    final List<T> nextBatch = poll();
    if (nextBatch != null) {
      output.add(nextBatch);
      return nextBatch.size();
    }
    return 0;
  }
Instantiates a new Batching read pipe.

@param input the input
@param maximumBatchSize the maximum batch size
@param batchCounter the batch counter
@param batchEndCondition the batch end condition
services/pipeline/src/main/java/org/hyperledger/besu/services/pipeline/BatchingReadPipe.java