Program: 136393
Project: 136393
Buggy source:
@Test public void testHeirarchy(){
  CoreObjectNode nco=createCoreInMinor();
  Assert.assertTrue(nco.getParent() instanceof VersionNode);
  Assert.assertTrue(nco.getLibrary() == minorLibrary);
  Assert.assertTrue(nco.getParent() == nco.getVersionNode());
  Assert.assertTrue(nco.getVersionNode().getNewestVersion() == nco);
  Assert.assertTrue(co.getVersionNode().getNewestVersion() == nco);
  Assert.assertTrue(nco.getVersionNode().getPreviousVersion() == co);
  Assert.assertTrue(co.getVersionNode().getPreviousVersion() == null);
  Node head=chain.getHead();
  Assert.assertTrue(head instanceof LibraryNode);
  Assert.assertTrue(head.getParent().getParent() == chain);
  Assert.assertTrue(head.getChain() == chain);
  Node versionsAgg=chain.getVersions();
  Assert.assertTrue(versionsAgg instanceof VersionAggregateNode);
  Assert.assertEquals(TotalLibraries,versionsAgg.getChildren().size());
  Assert.assertEquals(TotalLibraries,versionsAgg.getNavChildren().size());
  Assert.assertTrue(versionsAgg.getParent() == chain);
  Assert.assertTrue(versionsAgg.getChain() == chain);
  for (  Node lib : versionsAgg.getChildren()) {
    Assert.assertTrue(lib.getParent() == versionsAgg);
    Assert.assertTrue(lib instanceof LibraryNode);
    if (lib == chain.getHead())     Assert.assertTrue(lib.isEditable());
 else     Assert.assertFalse(lib.isEditable());
    checkChildrenClassType(lib,NavNode.class,ServiceNode.class);
    for (    Node nn : lib.getChildren()) {
      if (nn instanceof NavNode) {
        Assert.assertTrue(nn.getParent() == lib);
        checkChildrenClassType(nn,VersionNode.class,null);
        for (        Node vn : nn.getChildren()) {
          Assert.assertTrue(vn.getParent() == nn);
          Assert.assertEquals(1,vn.getChildren().size());
          checkChildrenClassType(vn,ComponentNode.class,null);
          for (          Node cc : vn.getChildren())           Assert.assertTrue(cc.getParent() == vn);
        }
      }
 else {
        checkChildrenClassType(nn,OperationNode.class,null);
      }
    }
  }
  Node complexAgg=(Node)chain.getComplexAggregate();
  Assert.assertTrue(complexAgg.getParent() == chain);
  checkChildrenClassType(complexAgg,ComplexComponentInterface.class,null);
  for (  Node n : complexAgg.getChildren())   Assert.assertTrue(n.getParent() != complexAgg);
  Node simpleAgg=(Node)chain.getSimpleAggregate();
  Assert.assertTrue(simpleAgg.getParent() == chain);
  checkChildrenClassType(simpleAgg,SimpleComponentInterface.class,null);
  for (  Node n : simpleAgg.getChildren())   Assert.assertTrue(n.getParent() != simpleAgg);
  Node svcAgg=(Node)chain.getServiceAggregate();
  Assert.assertTrue(svcAgg.getParent() == chain);
}

Fixed version (ground truth):
@Test public void testHeirarchy(){
  CoreObjectNode nco=createCoreInMinor();
  Assert.assertTrue(nco.getParent() instanceof VersionNode);
  Assert.assertTrue(nco.getLibrary() == minorLibrary);
  Assert.assertTrue(nco.getParent() == nco.getVersionNode());
  Assert.assertTrue(nco.getVersionNode().getNewestVersion() == nco);
  Assert.assertTrue(co.getVersionNode().getNewestVersion() == nco);
  Assert.assertTrue(nco.getVersionNode().getPreviousVersion() == co);
  Assert.assertTrue(co.getVersionNode().getPreviousVersion() == null);
  Node head=chain.getHead();
  Assert.assertTrue(head instanceof LibraryNode);
  Assert.assertTrue(head.getParent().getParent() == chain);
  Assert.assertTrue(head.getChain() == chain);
  Node versionsAgg=chain.getVersions();
  Assert.assertTrue(versionsAgg instanceof VersionAggregateNode);
  Assert.assertEquals(TotalLibraries,versionsAgg.getChildren().size());
  Assert.assertEquals(TotalLibraries,versionsAgg.getNavChildren().size());
  Assert.assertTrue(versionsAgg.getParent() == chain);
  Assert.assertTrue(versionsAgg.getChain() == chain);
  for (  Node lib : versionsAgg.getChildren()) {
    Assert.assertTrue(lib.getParent() == versionsAgg);
    Assert.assertTrue(lib instanceof LibraryNode);
    if (lib == chain.getHead())     Assert.assertTrue(lib.isEditable());
 else     Assert.assertFalse(lib.isEditable());
    checkChildrenClassType(lib,NavNode.class,ServiceNode.class);
    for (    Node nn : lib.getChildren()) {
      if (nn instanceof NavNode) {
        Assert.assertTrue(nn.getParent() == lib);
        checkChildrenClassType(nn,VersionNode.class,null);
        for (        Node vn : nn.getChildren()) {
          Assert.assertTrue(vn.getParent() == nn);
          Assert.assertEquals(1,vn.getChildren().size());
          checkChildrenClassType(vn,ComponentNode.class,null);
          for (          Node cc : vn.getChildren()) {
            Assert.assertTrue(cc.getParent() == vn);
          }
        }
      }
 else {
        checkChildrenClassType(nn,OperationNode.class,null);
      }
    }
  }
  Node complexAgg=(Node)chain.getComplexAggregate();
  Assert.assertTrue(complexAgg.getParent() == chain);
  checkChildrenClassType(complexAgg,ComplexComponentInterface.class,null);
  for (  Node n : complexAgg.getChildren())   Assert.assertTrue(n.getParent() != complexAgg);
  Node simpleAgg=(Node)chain.getSimpleAggregate();
  Assert.assertTrue(simpleAgg.getParent() == chain);
  checkChildrenClassType(simpleAgg,SimpleComponentInterface.class,null);
  for (  Node n : simpleAgg.getChildren())   Assert.assertTrue(n.getParent() != simpleAgg);
  Node svcAgg=(Node)chain.getServiceAggregate();
  Assert.assertTrue(svcAgg.getParent() == chain);
}