@Test public void expectAtMostOneOrEmpty() { Mono<Integer> mono = workshop.expectAtMostOneOrEmpty(Flux.just(1, 2, 3)); StepVerifier.create(mono) .expectError() .verify(); StepVerifier.create(Flux.just(1)).expectNext(1).verifyComplete(); StepVerifier.create(Flux.empty()).verifyComplete(); }
Mono<Integer> expectAtMostOneOrEmpty(Flux<Integer> flux) { return flux.singleOrEmpty().log(); }
Part03Filtering { Mono<Integer> expectAtMostOneOrEmpty(Flux<Integer> flux) { return flux.singleOrEmpty().log(); } }
Part03Filtering { Mono<Integer> expectAtMostOneOrEmpty(Flux<Integer> flux) { return flux.singleOrEmpty().log(); }  }
Part03Filtering { Mono<Integer> expectAtMostOneOrEmpty(Flux<Integer> flux) { return flux.singleOrEmpty().log(); }   }
Part03Filtering { Mono<Integer> expectAtMostOneOrEmpty(Flux<Integer> flux) { return flux.singleOrEmpty().log(); }    }