reactor-core/src/main/java/reactor/core/publisher/ParallelFlux.java
public final Flux<T> sorted(Comparator<? super T> comparator, int capacityHint) {
		int ch = capacityHint / parallelism() + 1;
		ParallelFlux<List<T>> railReduced = reduce(() -> new ArrayList<>(ch), (a, b) -> {
					a.add(b);
					return a;
				});
		ParallelFlux<List<T>> railSorted = railReduced.map(list -> {
			list.sort(comparator);
			return list;
		});

		return Flux.onAssembly(new ParallelMergeSort<>(railSorted, comparator));
	}
public final Flux<T> sorted(Comparator<? super T> comparator, int capacityHint) {
		int ch = capacityHint / parallelism() + 1;
		ParallelFlux<List<T>> railReduced = reduce(() -> new ArrayList<>(ch), (a, b) -> {
					a.add(b);
					return a;
				});
		ParallelFlux<List<T>> railSorted = railReduced.map(list -> {
			list.sort(comparator);
			return list;
		});

		return Flux.onAssembly(new ParallelMergeSort<>(railSorted, comparator));
	}
Sorts the 'rails' of this {@link ParallelFlux} and returns a Publisher that
sequentially picks the smallest next value from the rails.
<p>
This operator requires a finite source ParallelFlux.

@param comparator the comparator to use
@param capacityHint the expected number of total elements

@return the new Flux instance