@Test(expected = IllegalArgumentException.class)
public void testInvalidCompletion() {

    engine = new Engine();
    List<Stage> stages = new ArrayList<>();
    stages.add((Stage.PublisherStage) Flowable::empty);
    stages.add((Stage.Map) () -> i -> (int) i + 1);
    // This graph is not closed - so it's invalid
    Graph graph = () -> stages;
    engine.buildCompletion(graph);
}