Program: 104394
Project: 104394
Buggy source:
/** 
 * Verifies whether contacts are properly ordered according to their current status and name Checks whether reordered events are issued once a contact inside this group changes its status or is added removed a contact.
 */
public void testContactsOrder(){
  assertContactsOrder(fixture.metaClService.getRoot());
  MclEventCollector evtCollector=new MclEventCollector();
  fixture.metaClService.addMetaContactListListener(evtCollector);
  ((MockPersistentPresenceOperationSet)fixture.mockPresOpSet).changePresenceStatusForContact(MetaContactListServiceLick.mockContactToReorder,MockStatusEnum.MOCK_STATUS_100);
  fixture.metaClService.removeMetaContactListListener(evtCollector);
  assertEquals("String_Node_Str",1,evtCollector.collectedMetaContactGroupEvents.size());
  MetaContactGroupEvent evt=(MetaContactGroupEvent)evtCollector.collectedMetaContactGroupEvents.remove(0);
  assertEquals("String_Node_Str",MetaContactGroupEvent.CHILD_CONTACTS_REORDERED,evt.getEventID());
  assertEquals("String_Node_Str",fixture.metaClService.getRoot(),evt.getSourceMetaContactGroup());
  MetaContact theReorderedContact=fixture.metaClService.getRoot().getMetaContact(0);
  assertEquals(MetaContactListServiceLick.mockContactToReorder + "String_Node_Str" + "String_Node_Str",MetaContactListServiceLick.mockContactToReorder.getDisplayName(),theReorderedContact.getDisplayName());
  assertContactsOrder(fixture.metaClService.getRoot());
  ((MockPersistentPresenceOperationSet)fixture.mockPresOpSet).changePresenceStatusForContact(MetaContactListServiceLick.mockContactToReorder,MockStatusEnum.MOCK_STATUS_00);
  fixture.metaClService.addMetaContactListListener(evtCollector);
  fixture.metaClService.renameMetaContact(theReorderedContact,"String_Node_Str");
  fixture.metaClService.removeMetaContactListListener(evtCollector);
  assertEquals("String_Node_Str" + "String_Node_Str",1,evtCollector.collectedMetaContactGroupEvents.size());
  evt=(MetaContactGroupEvent)evtCollector.collectedMetaContactGroupEvents.remove(0);
  assertEquals("String_Node_Str",MetaContactGroupEvent.CHILD_CONTACTS_REORDERED,evt.getEventID());
  assertEquals("String_Node_Str",fixture.metaClService.getRoot(),evt.getSourceMetaContactGroup());
  assertSame(MetaContactListServiceLick.mockContactToReorder + "String_Node_Str" + "String_Node_Str",theReorderedContact,fixture.metaClService.getRoot().getMetaContact(fixture.metaClService.getRoot().countChildContacts() - 1));
}

Fixed version (ground truth):
/** 
 * Verifies whether contacts are properly ordered according to their current status and name Checks whether reordered events are issued once a contact inside this group changes its status or is added removed a contact.
 */
public void testContactsOrder(){
  assertContactsOrder(fixture.metaClService.getRoot());
  MclEventCollector evtCollector=new MclEventCollector();
  fixture.metaClService.addMetaContactListListener(evtCollector);
  ((MockPersistentPresenceOperationSet)fixture.mockPresOpSet).changePresenceStatusForContact(MetaContactListServiceLick.mockContactToReorder,MockStatusEnum.MOCK_STATUS_100);
  fixture.metaClService.removeMetaContactListListener(evtCollector);
  assertEquals("String_Node_Str",1,evtCollector.collectedMetaContactGroupEvents.size());
  MetaContactGroupEvent evt=(MetaContactGroupEvent)evtCollector.collectedMetaContactGroupEvents.remove(0);
  assertEquals("String_Node_Str",MetaContactGroupEvent.CHILD_CONTACTS_REORDERED,evt.getEventID());
  assertEquals("String_Node_Str",fixture.metaClService.getRoot(),evt.getSourceMetaContactGroup());
  assertContactsOrder(fixture.metaClService.getRoot());
  ((MockPersistentPresenceOperationSet)fixture.mockPresOpSet).changePresenceStatusForContact(MetaContactListServiceLick.mockContactToReorder,MockStatusEnum.MOCK_STATUS_00);
  fixture.metaClService.addMetaContactListListener(evtCollector);
  MetaContact theReorderedContact=fixture.metaClService.findMetaContactByContact(MetaContactListServiceLick.mockContactToReorder);
  fixture.metaClService.renameMetaContact(theReorderedContact,"String_Node_Str");
  fixture.metaClService.removeMetaContactListListener(evtCollector);
  assertEquals("String_Node_Str" + "String_Node_Str",1,evtCollector.collectedMetaContactGroupEvents.size());
  evt=(MetaContactGroupEvent)evtCollector.collectedMetaContactGroupEvents.remove(0);
  assertEquals("String_Node_Str",MetaContactGroupEvent.CHILD_CONTACTS_REORDERED,evt.getEventID());
  assertEquals("String_Node_Str",fixture.metaClService.getRoot(),evt.getSourceMetaContactGroup());
  assertSame(MetaContactListServiceLick.mockContactToReorder + "String_Node_Str" + "String_Node_Str",theReorderedContact,fixture.metaClService.getRoot().getMetaContact(fixture.metaClService.getRoot().countChildContacts() - 1));
}