@Test public void createWithoutPredicate() { assertThrows(NullPointerException.class, () -> factory.create(null, () -> null)); }
@SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.TakeWhile stage) { Predicate<I> predicate = (Predicate<I>) Objects.requireNonNull(stage.getPredicate()); return source -> (Multi<O>) source.transform().byTakingItemsWhile(predicate); }
TakeWhileStageFactory implements ProcessingStageFactory<Stage.TakeWhile> { @SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.TakeWhile stage) { Predicate<I> predicate = (Predicate<I>) Objects.requireNonNull(stage.getPredicate()); return source -> (Multi<O>) source.transform().byTakingItemsWhile(predicate); } }
TakeWhileStageFactory implements ProcessingStageFactory<Stage.TakeWhile> { @SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.TakeWhile stage) { Predicate<I> predicate = (Predicate<I>) Objects.requireNonNull(stage.getPredicate()); return source -> (Multi<O>) source.transform().byTakingItemsWhile(predicate); }  }
TakeWhileStageFactory implements ProcessingStageFactory<Stage.TakeWhile> { @SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.TakeWhile stage) { Predicate<I> predicate = (Predicate<I>) Objects.requireNonNull(stage.getPredicate()); return source -> (Multi<O>) source.transform().byTakingItemsWhile(predicate); }  @SuppressWarnings("unchecked") @Override ProcessingStage<I, O> create(Engine engine, Stage.TakeWhile stage); }
TakeWhileStageFactory implements ProcessingStageFactory<Stage.TakeWhile> { @SuppressWarnings("unchecked") @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.TakeWhile stage) { Predicate<I> predicate = (Predicate<I>) Objects.requireNonNull(stage.getPredicate()); return source -> (Multi<O>) source.transform().byTakingItemsWhile(predicate); }  @SuppressWarnings("unchecked") @Override ProcessingStage<I, O> create(Engine engine, Stage.TakeWhile stage);  }