Program: 135293
Project: 135293
Buggy source:
/** 
 * Test when A and B and C update at overlapping times but C's events appear before A and B in the input events List A's events are too far apart to be considered in the same group A1 -> C1 -> A2 -> B1 -> C2 -> B2 Expected: [[A1], [A2], [C1, C2], [B1, B2]]
 */
@Test public void testLabelUpdateEventsGrouping7(){
  List<TurboIssueEvent> events=new ArrayList<>();
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Labeled,new GregorianCalendar(2015,1,1,1,5,0),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Unlabeled,new GregorianCalendar(2015,1,1,1,5,40),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Labeled,new GregorianCalendar(2015,1,1,1,5,59),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Unlabeled,new GregorianCalendar(2015,1,1,1,4,55),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Unlabeled,new GregorianCalendar(2015,1,1,1,6,15),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Labeled,new GregorianCalendar(2015,1,1,1,3,40),"String_Node_Str"));
  List<TurboIssueEvent> expectedSubList1=new ArrayList<>();
  expectedSubList1.add(events.get(5));
  List<TurboIssueEvent> expectedSubList2=new ArrayList<>();
  expectedSubList2.add(events.get(3));
  List<TurboIssueEvent> expectedSubList3=new ArrayList<>();
  expectedSubList3.add(events.get(0));
  expectedSubList3.add(events.get(2));
  List<TurboIssueEvent> expectedSubList4=new ArrayList<>();
  expectedSubList4.add(events.get(1));
  expectedSubList4.add(events.get(4));
  List<List<TurboIssueEvent>> expected=new ArrayList<>();
  expected.add(expectedSubList1);
  expected.add(expectedSubList2);
  expected.add(expectedSubList3);
  expected.add(expectedSubList4);
  assertEquals(expected,TurboIssueEvent.groupLabelUpdateEvents(events));
}

Fixed version (ground truth):
/** 
 * Tests when A and B and C update at overlapping times but C's events appear before A and B in the input events List A's events are too far apart to be considered in the same group A1 -> C1 -> A2 -> B1 -> C2 -> B2 Expected: [[A1], [A2], [C1, C2], [B1, B2]]
 */
@Test public void testLabelUpdateEventsGrouping7(){
  List<TurboIssueEvent> events=new ArrayList<>();
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Labeled,new GregorianCalendar(2015,1,1,1,5,0),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Unlabeled,new GregorianCalendar(2015,1,1,1,5,40),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Labeled,new GregorianCalendar(2015,1,1,1,5,59),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Unlabeled,new GregorianCalendar(2015,1,1,1,4,55),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Unlabeled,new GregorianCalendar(2015,1,1,1,6,15),"String_Node_Str"));
  events.add(createLabelUpdateEvent("String_Node_Str",IssueEventType.Labeled,new GregorianCalendar(2015,1,1,1,3,40),"String_Node_Str"));
  List<TurboIssueEvent> expectedSubList1=new ArrayList<>();
  expectedSubList1.add(events.get(5));
  List<TurboIssueEvent> expectedSubList2=new ArrayList<>();
  expectedSubList2.add(events.get(3));
  List<TurboIssueEvent> expectedSubList3=new ArrayList<>();
  expectedSubList3.add(events.get(0));
  expectedSubList3.add(events.get(2));
  List<TurboIssueEvent> expectedSubList4=new ArrayList<>();
  expectedSubList4.add(events.get(1));
  expectedSubList4.add(events.get(4));
  List<List<TurboIssueEvent>> expected=new ArrayList<>();
  expected.add(expectedSubList1);
  expected.add(expectedSubList2);
  expected.add(expectedSubList3);
  expected.add(expectedSubList4);
  assertEquals(expected,TurboIssueEvent.groupLabelUpdateEvents(events));
}