public <O> PipelineBuilder<I, O> thenFlatMapInParallel(
      final String stageName,
      final Function<T, Stream<O>> mapper,
      final int numberOfThreads,
      final int newBufferSize) {
    return thenProcessInParallel(
        stageName, () -> new FlatMapProcessor<>(mapper), numberOfThreads, newBufferSize);
  }
Adds a 1-to-many processing stage to the pipeline. For each item in the stream, <i>mapper</i>
is called and each item of the {@link Stream} it returns is output as an individual item. The
returned Stream may be empty to remove an item. Multiple threads process items in the pipeline
concurrently.

<p>This can be used to reverse the effect of {@link #inBatches(int)} with:

<pre>thenFlatMap(List::stream, newBufferSize)</pre>

@param <O> the type of items to be output from this stage.
@param stageName the name of this stage. Used as the label for the output count metric.
@param mapper the function to process each item with.
@param numberOfThreads the number of threads to use for processing.
@param newBufferSize the output buffer size to use from this stage onwards.
@return a {@link PipelineBuilder} ready to extend the pipeline with additional stages.
services/pipeline/src/main/java/org/hyperledger/besu/services/pipeline/PipelineBuilder.java