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 Flowable.fromPublisher(fromCompletionStage(cs, false)); }; }  @Override PublisherStage<O> create(Engine engine, Stage.FromCompletionStage stage);  }
@Test(expected = NullPointerException.class) public void createWithoutStage() { factory.create(null, null); }
@Test(expected = NullPointerException.class) public void createWithNullAsResult() { factory.create(null, () -> null).get(); }