reactor-core/src/main/java/reactor/core/publisher/Flux.java
public final <K> Mono<Map<K, T>> collectMap(Function<? super T, ? extends K> keyExtractor) {
		return collectMap(keyExtractor, identityFunction());
	}
public final <K> Mono<Map<K, T>> collectMap(Function<? super T, ? extends K> keyExtractor) {
		return collectMap(keyExtractor, identityFunction());
	}
Collect all elements emitted by this {@link Flux} into a hashed {@link Map} that is
emitted by the resulting {@link Mono} when this sequence completes.
The key is extracted from each element by applying the {@code keyExtractor}
{@link Function}. In case several elements map to the same key, the associated value
will be the most recently emitted element.

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

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

@param keyExtractor a {@link Function} to map elements to a key for the {@link Map}
@param <K> the type of the key extracted from each source element

@return a {@link Mono} of a {@link Map} of key-element pairs (only including latest
element in case of key conflicts)