@Test public void create() throws ExecutionException, InterruptedException { Flowable<Integer> flowable = Flowable.fromArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) .subscribeOn(Schedulers.computation()); List<Integer> list = ReactiveStreams.fromPublisher(flowable).dropWhile(i -> i < 6).toList().run() .toCompletableFuture().get(); assertThat(list).hasSize(5).containsExactly(6, 7, 8, 9, 10); }
@Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.DropWhile stage) { Predicate<I> predicate = Casts.cast(stage.getPredicate()); return Casts.cast(new TakeWhile<>(predicate)); }
DropWhileStageFactory implements ProcessingStageFactory<Stage.DropWhile> { @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.DropWhile stage) { Predicate<I> predicate = Casts.cast(stage.getPredicate()); return Casts.cast(new TakeWhile<>(predicate)); } }
DropWhileStageFactory implements ProcessingStageFactory<Stage.DropWhile> { @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.DropWhile stage) { Predicate<I> predicate = Casts.cast(stage.getPredicate()); return Casts.cast(new TakeWhile<>(predicate)); }  }
DropWhileStageFactory implements ProcessingStageFactory<Stage.DropWhile> { @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.DropWhile stage) { Predicate<I> predicate = Casts.cast(stage.getPredicate()); return Casts.cast(new TakeWhile<>(predicate)); }  @Override ProcessingStage<I, O> create(Engine engine, Stage.DropWhile stage); }
DropWhileStageFactory implements ProcessingStageFactory<Stage.DropWhile> { @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.DropWhile stage) { Predicate<I> predicate = Casts.cast(stage.getPredicate()); return Casts.cast(new TakeWhile<>(predicate)); }  @Override ProcessingStage<I, O> create(Engine engine, Stage.DropWhile stage);  }