@Test public void takeAtMostOne() { Mono<Integer> mono = workshop.emitLast(Flux.just(51, 61, 12)); StepVerifier.create(mono) .expectNext(12) .verifyComplete(); mono = workshop.emitLast(Flux.empty()); StepVerifier.create(mono).expectNext(100).verifyComplete(); }
Mono<Integer> emitLast(Flux<Integer> flux) { return flux.last(100).log(); }
Part03Filtering { Mono<Integer> emitLast(Flux<Integer> flux) { return flux.last(100).log(); } }
Part03Filtering { Mono<Integer> emitLast(Flux<Integer> flux) { return flux.last(100).log(); }  }
Part03Filtering { Mono<Integer> emitLast(Flux<Integer> flux) { return flux.last(100).log(); }   }
Part03Filtering { Mono<Integer> emitLast(Flux<Integer> flux) { return flux.last(100).log(); }    }