private <T> Mono<T> createMono(Function<ReactiveStreamCommands, Publisher<T>> function) { Assert.notNull(function, "Function must not be null!"); return template.createMono(connection -> function.apply(connection.streamCommands())); }
private <T> Flux<T> createFlux(Function<ReactiveStreamCommands, Publisher<T>> function) { Assert.notNull(function, "Function must not be null!"); return template.createFlux(connection -> function.apply(connection.streamCommands())); }