@Test public void create() throws ExecutionException, InterruptedException { Multi<Integer> publisher = Multi.createFrom().items(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) .emitOn(executor); List<Integer> list = ReactiveStreams.fromPublisher(publisher).skip(5).toList().run() .toCompletableFuture().get(); assertThat(list).hasSize(5).containsExactly(6, 7, 8, 9, 10); }
@SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.Skip stage) { long skip = stage.getSkip(); return source -> (Multi<O>) source.transform().bySkippingFirstItems(skip); }
SkipStageFactory implements ProcessingStageFactory<Stage.Skip> { @SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.Skip stage) { long skip = stage.getSkip(); return source -> (Multi<O>) source.transform().bySkippingFirstItems(skip); } }
SkipStageFactory implements ProcessingStageFactory<Stage.Skip> { @SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.Skip stage) { long skip = stage.getSkip(); return source -> (Multi<O>) source.transform().bySkippingFirstItems(skip); }  }
SkipStageFactory implements ProcessingStageFactory<Stage.Skip> { @SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.Skip stage) { long skip = stage.getSkip(); return source -> (Multi<O>) source.transform().bySkippingFirstItems(skip); }  @SuppressWarnings("unchecked") @Override ProcessingStage<I, O> create(Engine engine, Stage.Skip stage); }
SkipStageFactory implements ProcessingStageFactory<Stage.Skip> { @SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.Skip stage) { long skip = stage.getSkip(); return source -> (Multi<O>) source.transform().bySkippingFirstItems(skip); }  @SuppressWarnings("unchecked") @Override ProcessingStage<I, O> create(Engine engine, Stage.Skip stage);  }