Program: 4638
Project: 4638
Buggy source:
@Test public void testSplitByControlNodes() throws Exception {
  Dag dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Set<Dag> actual=dag.splitByControlNodes(new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str")));
  Set<Dag> expectedDags=new HashSet<>();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str")));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
}

Fixed version (ground truth):
@Test public void testSplitByControlNodes() throws Exception {
  Dag dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Set<Dag> actual=dag.splitByControlNodes(new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str")));
  Set<Dag> expectedDags=new HashSet<>();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str")));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(ImmutableSet.of("String_Node_Str"));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(ImmutableSet.of("String_Node_Str"));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
  dag=new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  actual=dag.splitByControlNodes(ImmutableSet.of("String_Node_Str","String_Node_Str"));
  expectedDags.clear();
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  expectedDags.add(new Dag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"))));
  Assert.assertEquals(expectedDags,actual);
}