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

    engine = new Engine();
    List<Stage> stages = new ArrayList<>();
    stages.add((Stage.Map) () -> i -> (int) i + 1);
    stages.add(new Stage.FindFirst() {
    });
    // This graph is closed, invalid as publisher
    Graph graph = () -> stages;
    engine.buildPublisher(graph);
}