@Test public void createWithNullAsResult() { assertThrows(NullPointerException.class, () -> factory.create(null, () -> null).get()); }
@Override public <O> PublisherStage<O> create(Engine engine, Stage.FromCompletionStage stage) { Objects.requireNonNull(stage); return () -> { CompletionStage<O> cs = Casts.cast(Objects.requireNonNull(stage.getCompletionStage())); return Multi.createFrom().completionStage(cs) .onCompletion().ifEmpty().failWith(NullPointerException::new); }; }
FromCompletionStageFactory implements PublisherStageFactory<Stage.FromCompletionStage> { @Override public <O> PublisherStage<O> create(Engine engine, Stage.FromCompletionStage stage) { Objects.requireNonNull(stage); return () -> { CompletionStage<O> cs = Casts.cast(Objects.requireNonNull(stage.getCompletionStage())); return Multi.createFrom().completionStage(cs) .onCompletion().ifEmpty().failWith(NullPointerException::new); }; } }
FromCompletionStageFactory implements PublisherStageFactory<Stage.FromCompletionStage> { @Override public <O> PublisherStage<O> create(Engine engine, Stage.FromCompletionStage stage) { Objects.requireNonNull(stage); return () -> { CompletionStage<O> cs = Casts.cast(Objects.requireNonNull(stage.getCompletionStage())); return Multi.createFrom().completionStage(cs) .onCompletion().ifEmpty().failWith(NullPointerException::new); }; }  }
FromCompletionStageFactory implements PublisherStageFactory<Stage.FromCompletionStage> { @Override public <O> PublisherStage<O> create(Engine engine, Stage.FromCompletionStage stage) { Objects.requireNonNull(stage); return () -> { CompletionStage<O> cs = Casts.cast(Objects.requireNonNull(stage.getCompletionStage())); return Multi.createFrom().completionStage(cs) .onCompletion().ifEmpty().failWith(NullPointerException::new); }; }  @Override PublisherStage<O> create(Engine engine, Stage.FromCompletionStage stage); }
FromCompletionStageFactory implements PublisherStageFactory<Stage.FromCompletionStage> { @Override public <O> PublisherStage<O> create(Engine engine, Stage.FromCompletionStage stage) { Objects.requireNonNull(stage); return () -> { CompletionStage<O> cs = Casts.cast(Objects.requireNonNull(stage.getCompletionStage())); return Multi.createFrom().completionStage(cs) .onCompletion().ifEmpty().failWith(NullPointerException::new); }; }  @Override PublisherStage<O> create(Engine engine, Stage.FromCompletionStage stage);  }