### Question:
GraphPipeline implements Pipeline { @Override public PipelineExecutor executor() { return new GraphPipelineExecutor(this); } GraphPipeline(@JsonProperty("steps") Map<String, GraphStep> steps,
                         @JsonProperty("outputStep") String outputStep,
                         @JsonProperty("id") String id); @Override PipelineExecutor executor(); @Override int size(); @Override String id(); static final String INPUT_KEY; }### Answer:
@Test public void testSimple(){ GraphBuilder b = new GraphBuilder(); GraphStep input = b.input(); Pipeline p = b.build(input); Data in = Data.singleton("in", "value"); PipelineExecutor exec = p.executor(); Data out = exec.exec(in); assertEquals(in, out); }
@Test public void testSimple2(){ GraphBuilder b = new GraphBuilder(); GraphStep input = b.input(); List<String> execOrder = new ArrayList<>(); GraphStep step1 = input.then("step1", new CallbackStep(d -> execOrder.add("step1"))); GraphStep step2 = step1.then("step2", new CallbackStep(d -> execOrder.add("step2"))); GraphStep step3 = step2.then("step3", new CallbackStep(d -> execOrder.add("step3"))); Pipeline p = b.build(step3); Data in = Data.singleton("in", "value"); PipelineExecutor exec = p.executor(); Data out = exec.exec(in); assertEquals(in, out); assertEquals(Arrays.asList("step1", "step2", "step3"), execOrder); }