@Test public void thenFlatComposeOnOptionalShouldTransformUnderlyingValuesAndComposeFuturesWithOptionalUnboxing() { assertThat( FluentFutureStream.of( CompletableFuture.completedFuture( Stream.of(1, 2, 3))) .thenFlatComposeOnOptional(i -> CompletableFuture.completedFuture(Optional.of(i + 1) .filter(j -> j % 2 == 0))) .join() .collect(Guavate.toImmutableList())) .containsExactly(2, 4); }