Program: 9742
Project: 9742
Buggy source:
@Test public void testLGGWithTrees(){
  QueryTreeFactory<String> factory=new QueryTreeFactoryImpl();
  Set<QueryTree<String>> posExampleTrees=DBpediaExample.getPosExampleTrees();
  int cnt=1;
  for (  QueryTree<String> tree : posExampleTrees) {
    System.out.println("String_Node_Str" + cnt);
    tree.dump(new PrintWriter(System.out));
    System.out.println("String_Node_Str");
    cnt++;
  }
  LGGGenerator<String> lggGenerator=new LGGGeneratorImpl<String>();
  QueryTree<String> lgg=lggGenerator.getLGG(posExampleTrees);
  System.out.println("String_Node_Str");
  lgg.dump(new PrintWriter(System.out));
  QueryTreeImpl<String> tree=factory.getQueryTree("String_Node_Str");
  QueryTreeImpl<String> subTree1=new QueryTreeImpl<String>("String_Node_Str");
  subTree1.addChild(new QueryTreeImpl<String>("String_Node_Str"),"String_Node_Str");
  subTree1.addChild(new QueryTreeImpl<String>("String_Node_Str"),"String_Node_Str");
  subTree1.addChild(new QueryTreeImpl<String>("String_Node_Str"),"String_Node_Str");
  tree.addChild(subTree1,"String_Node_Str");
  tree.addChild(new QueryTreeImpl<String>("String_Node_Str"),RDFS.label.toString());
  QueryTreeImpl<String> subTree2=new QueryTreeImpl<String>("String_Node_Str");
  subTree2.addChild(new QueryTreeImpl<String>(OWL.Thing.toString()),RDFS.subClassOf.toString());
  tree.addChild(subTree2,RDF.type.toString());
  QueryTreeImpl<String> subTree3=new QueryTreeImpl<String>("String_Node_Str");
  QueryTreeImpl<String> subSubTree=new QueryTreeImpl<String>("String_Node_Str");
  subSubTree.addChild(new QueryTreeImpl<String>(OWL.Thing.toString()),RDFS.subClassOf.toString());
  subTree3.addChild(subSubTree,RDFS.subClassOf.toString());
  tree.addChild(subTree3,RDF.type.toString());
  Assert.assertTrue(lgg.isSameTreeAs(tree));
}

Fixed version (ground truth):
@Test public void testLGGWithTrees(){
  QueryTreeFactory<String> factory=new QueryTreeFactoryImpl();
  Set<QueryTree<String>> posExampleTrees=DBpediaExample.getPosExampleTrees();
  int cnt=1;
  for (  QueryTree<String> tree : posExampleTrees) {
    System.out.println("String_Node_Str" + cnt);
    tree.dump();
    System.out.println("String_Node_Str");
    cnt++;
  }
  LGGGenerator<String> lggGenerator=new LGGGeneratorImpl<String>();
  QueryTree<String> lgg=lggGenerator.getLGG(posExampleTrees);
  System.out.println("String_Node_Str");
  lgg.dump();
  QueryTreeImpl<String> tree=factory.getQueryTree("String_Node_Str");
  QueryTreeImpl<String> subTree1=new QueryTreeImpl<String>("String_Node_Str");
  subTree1.addChild(new QueryTreeImpl<String>("String_Node_Str"),"String_Node_Str");
  subTree1.addChild(new QueryTreeImpl<String>("String_Node_Str"),"String_Node_Str");
  subTree1.addChild(new QueryTreeImpl<String>("String_Node_Str"),"String_Node_Str");
  tree.addChild(subTree1,"String_Node_Str");
  tree.addChild(new QueryTreeImpl<String>("String_Node_Str"),RDFS.label.toString());
  QueryTreeImpl<String> subTree2=new QueryTreeImpl<String>("String_Node_Str");
  subTree2.addChild(new QueryTreeImpl<String>(OWL.Thing.toString()),RDFS.subClassOf.toString());
  tree.addChild(subTree2,RDF.type.toString());
  QueryTreeImpl<String> subTree3=new QueryTreeImpl<String>("String_Node_Str");
  QueryTreeImpl<String> subSubTree=new QueryTreeImpl<String>("String_Node_Str");
  subSubTree.addChild(new QueryTreeImpl<String>(OWL.Thing.toString()),RDFS.subClassOf.toString());
  subTree3.addChild(subSubTree,RDFS.subClassOf.toString());
  tree.addChild(subTree3,RDF.type.toString());
  Assert.assertTrue(lgg.isSameTreeAs(tree));
}