private void createGraph3() {
    StreamApplicationDescriptorImpl appDesc = mock(StreamApplicationDescriptorImpl.class);
    graph3 = new JobGraph(new MapConfig(), appDesc);

    JobNode n1 = graph3.getOrCreateJobNode("1", "1");
    JobNode n2 = graph3.getOrCreateJobNode("2", "1");

    graph3.addInputStream(genStream(), n1);
    graph3.addIntermediateStream(genStream(), n1, n1);
    graph3.addIntermediateStream(genStream(), n1, n2);
    graph3.addIntermediateStream(genStream(), n2, n2);
  }
graph3 is a graph with two self loops
1<->1 -> 2<->2
samza-core/src/test/java/org/apache/samza/execution/TestJobGraph.java