reactor-core/src/main/java/reactor/core/publisher/Flux.java
public final <E> Mono<E> collect(Supplier<E> containerSupplier, BiConsumer<E, ? super T> collector) {
		return Mono.onAssembly(new MonoCollect<>(this, containerSupplier, collector));
	}
public final <E> Mono<E> collect(Supplier<E> containerSupplier, BiConsumer<E, ? super T> collector) {
		return Mono.onAssembly(new MonoCollect<>(this, containerSupplier, collector));
	}
Collect all elements emitted by this {@link Flux} into a user-defined container,
by applying a collector {@link BiConsumer} taking the container and each element.
The collected result will be emitted when this sequence completes.

<p>
<img class="marble" src="doc-files/marbles/collect.svg" alt="">

@param <E> the container type
@param containerSupplier the supplier of the container instance for each Subscriber
@param collector a consumer of both the container instance and the value being currently collected

@reactor.discard This operator discards the buffer upon cancellation or error triggered by a data signal.

@return a {@link Mono} of the collected container on complete