Program: 37625
Project: 37625
Buggy source:
@Test public void testTaskGroupInvocationShouldInvokePostRunDependentTaskGroup(){
  final LinkedList<String> group1Items=new LinkedList<>();
  final TaskGroup group1=createSampleTaskGroup("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",group1Items);
  final LinkedList<String> group2Items=new LinkedList<>();
  final TaskGroup group2=createSampleTaskGroup("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",group2Items);
  group1.addPostRunDependentTaskGroup(group2);
  group1Items.addAll(group2Items);
  group1.invokeAsync(group1.newInvocationContext()).subscribe(new Action1<Indexable>(){
    @Override public void call(    Indexable value){
      StringIndexable stringIndexable=toStringIndexable(value);
      Assert.assertTrue(group1Items.contains(stringIndexable.str()));
      group1Items.remove(stringIndexable.str());
    }
  }
);
  Assert.assertEquals(0,group1Items.size());
  Map<String,Set<String>> shouldNotSee=new HashMap<>();
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{}));
  Set<String> seen=new HashSet<>();
  group1.proxyTaskGroupWrapper.proxyTaskGroup().prepareForEnumeration();
  for (TaskGroupEntry<TaskItem> entry=group1.proxyTaskGroupWrapper.proxyTaskGroup().getNext(); entry != null; entry=group1.proxyTaskGroupWrapper.proxyTaskGroup().getNext()) {
    Assert.assertTrue(shouldNotSee.containsKey(entry.key()));
    Assert.assertFalse(seen.contains(entry.key()));
    Sets.SetView<String> common=Sets.intersection(shouldNotSee.get(entry.key()),seen);
    if (common.size() > 0) {
      Assert.assertTrue("String_Node_Str" + common + "String_Node_Str"+ entry.key(),false);
    }
    seen.add(entry.key());
    group1.proxyTaskGroupWrapper.proxyTaskGroup().reportCompletion(entry);
  }
  Assert.assertEquals(13,seen.size());
  Set<String> expectedToSee=new HashSet<>();
  expectedToSee.addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  Sets.SetView<String> diff=Sets.difference(seen,expectedToSee);
  Assert.assertEquals(0,diff.size());
  group1.invokeAsync(group1.newInvocationContext()).subscribe(new Action1<Indexable>(){
    @Override public void call(    Indexable indexable){
      System.out.println(indexable.key());
    }
  }
);
}

Fixed version (ground truth):
@Test public void testTaskGroupInvocationShouldInvokePostRunDependentTaskGroup(){
  final LinkedList<String> group1Items=new LinkedList<>();
  final TaskGroup group1=createSampleTaskGroup("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",group1Items);
  final LinkedList<String> group2Items=new LinkedList<>();
  final TaskGroup group2=createSampleTaskGroup("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",group2Items);
  group1.addPostRunDependentTaskGroup(group2);
  group1Items.addAll(group2Items);
  group1.invokeAsync(group1.newInvocationContext()).subscribe(new Action1<Indexable>(){
    @Override public void call(    Indexable value){
      StringIndexable stringIndexable=toStringIndexable(value);
      Assert.assertTrue(group1Items.contains(stringIndexable.str()));
      group1Items.remove(stringIndexable.str());
    }
  }
);
  Assert.assertEquals(0,group1Items.size());
  Map<String,Set<String>> shouldNotSee=new HashMap<>();
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{"String_Node_Str"}));
  shouldNotSee.put("String_Node_Str",new HashSet<String>());
  shouldNotSee.get("String_Node_Str").addAll(Arrays.asList(new String[]{}));
  Set<String> seen=new HashSet<>();
  group1.proxyTaskGroupWrapper.taskGroup().prepareForEnumeration();
  for (TaskGroupEntry<TaskItem> entry=group1.proxyTaskGroupWrapper.taskGroup().getNext(); entry != null; entry=group1.proxyTaskGroupWrapper.taskGroup().getNext()) {
    Assert.assertTrue(shouldNotSee.containsKey(entry.key()));
    Assert.assertFalse(seen.contains(entry.key()));
    Sets.SetView<String> common=Sets.intersection(shouldNotSee.get(entry.key()),seen);
    if (common.size() > 0) {
      Assert.assertTrue("String_Node_Str" + common + "String_Node_Str"+ entry.key(),false);
    }
    seen.add(entry.key());
    group1.proxyTaskGroupWrapper.taskGroup().reportCompletion(entry);
  }
  Assert.assertEquals(13,seen.size());
  Set<String> expectedToSee=new HashSet<>();
  expectedToSee.addAll(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  Sets.SetView<String> diff=Sets.difference(seen,expectedToSee);
  Assert.assertEquals(0,diff.size());
  group1.invokeAsync(group1.newInvocationContext()).subscribe(new Action1<Indexable>(){
    @Override public void call(    Indexable indexable){
      System.out.println(indexable.key());
    }
  }
);
}