Program: 50156
Project: 50156
Buggy source:
private Set<Node> mapGraphNodes(TreeNode treeNode,Tree tree,boolean external){
  HashSet<Node> graphNodesForParent=graphNodesForTreeNode.get(treeNode.getParent());
  TLongBipartition nodeBipart;
  TLongBipartition nodeBipartExp=null;
  if (external == false) {
    nodeBipart=bipartForTreeNode.get(treeNode);
  }
 else {
    nodeBipart=getGraphBipartForTreeNode(treeNode,tree);
  }
  System.out.println(treeNode.getNewick(false) + "String_Node_Str" + rankForTreeNode.get(treeNode));
  System.out.println("String_Node_Str" + nodeBipart);
  System.out.println("String_Node_Str" + graphNodesForParent);
  if (USING_TAXONOMY) {
    nodeBipartExp=getExpandedTaxonomyBipart(nodeBipart);
  }
  HashSet<Node> graphNodes=new HashSet<Node>();
  HashSet<Node> taxNodesMatched=new HashSet<Node>();
  for (  Node parent : graphNodesForParent) {
    for (    Relationship r : parent.getRelationships(Direction.INCOMING,RelType.MRCACHILDOF)) {
      Node potentialChild=r.getStartNode();
      TLongBipartition childBipart;
      TLongBipartition childBipartExp=null;
      if (USING_TAXONOMY == false || taxonomyGraphNodesMap.containsKey(potentialChild) == false) {
        childBipart=bipartForGraphNode.get(potentialChild);
      }
 else {
        childBipart=taxonomyGraphNodesMap.get(potentialChild);
        childBipartExp=childBipart;
      }
      if (childBipart == null)       continue;
      if (taxonomyGraphNodesMap.containsKey(potentialChild) == false && taxonomyGraphNodesMap.containsKey(parent)) {
        childBipartExp=getExpandedTaxonomyBipart(childBipart);
      }
      if (USING_TAXONOMY && taxonomyGraphNodesMap.containsKey(parent)) {
        if (taxonomyGraphNodesMap.containsKey(potentialChild)) {
          if (parent.equals(potentialChild) == false && childBipartExp.ingroup().containsAll(nodeBipartExp.ingroup()) && childBipartExp.ingroup().containsAny(nodeBipartExp.outgroup()) == false && taxonomyGraphNodesMap.get(parent).ingroup().containsAll(childBipartExp.ingroup())) {
            graphNodes.add(potentialChild);
            taxNodesMatched.add(potentialChild);
            updateSTREEChildOf(potentialChild,parent,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
            boolean going=true;
            Node curchild=potentialChild;
            while (going) {
              going=false;
              for (              Relationship rc : curchild.getRelationships(RelType.TAXCHILDOF,Direction.INCOMING)) {
                Node tch=rc.getStartNode();
                if (taxonomyGraphNodesMap.containsKey(tch) == false)                 continue;
                TLongBipartition tchb=taxonomyGraphNodesMap.get(tch);
                if (parent.equals(tch) == false && tchb.ingroup().containsAll(nodeBipartExp.ingroup()) && tchb.ingroup().containsAny(nodeBipartExp.outgroup()) == false && taxonomyGraphNodesMap.get(parent).ingroup().containsAll(tchb.ingroup())) {
                  graphNodes.add(tch);
                  taxNodesMatched.add(tch);
                  updateSTREEChildOf(tch,curchild,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
                  going=true;
                  curchild=tch;
                  break;
                }
              }
            }
          }
        }
 else {
          if (childBipartExp.containsAll(nodeBipartExp) && taxonomyGraphNodesMap.get(parent).ingroup().containsAll(childBipartExp.ingroup()) && taxonomyGraphNodesMap.get(parent).ingroup().containsAny(childBipartExp.outgroup())) {
            graphNodes.add(potentialChild);
            updateSTREEChildOf(potentialChild,parent,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
          }
        }
      }
 else       if (USING_TAXONOMY && taxonomyGraphNodesMap.containsKey(potentialChild)) {
        if (childBipartExp.ingroup().containsAll(nodeBipartExp.ingroup()) && childBipartExp.ingroup().containsAny(nodeBipartExp.outgroup()) == false) {
          graphNodes.add(potentialChild);
          taxNodesMatched.add(potentialChild);
          updateSTREEChildOf(potentialChild,parent,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
          boolean going=true;
          Node curchild=potentialChild;
          while (going) {
            going=false;
            for (            Relationship rc : curchild.getRelationships(RelType.TAXCHILDOF,Direction.INCOMING)) {
              Node tch=rc.getStartNode();
              if (taxonomyGraphNodesMap.containsKey(tch) == false)               continue;
              TLongBipartition tchb=taxonomyGraphNodesMap.get(tch);
              if (tchb.ingroup().containsAll(nodeBipartExp.ingroup()) && tchb.ingroup().containsAny(nodeBipartExp.outgroup()) == false) {
                graphNodes.add(tch);
                taxNodesMatched.add(tch);
                updateSTREEChildOf(tch,curchild,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
                going=true;
                curchild=tch;
                break;
              }
            }
          }
        }
      }
 else {
        TLongBipartition testParent=bipartForGraphNode.get(parent);
        if (USING_TAXONOMY) {
        }
        if (childBipart.containsAll(nodeBipart) && childBipart.isNestedPartitionOf(testParent)) {
          graphNodes.add(potentialChild);
          updateSTREEChildOf(potentialChild,parent,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
        }
      }
    }
  }
  for (  Node gn : taxNodesMatched) {
    for (    Relationship trel : gn.getRelationships(Direction.INCOMING,RelType.MRCACHILDOF)) {
      if (graphNodes.contains(trel.getStartNode())) {
        updateSTREEChildOf(trel.getStartNode(),gn,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
      }
    }
  }
  return graphNodes;
}

Fixed version (ground truth):
private Set<Node> mapGraphNodes(TreeNode treeNode,Tree tree,boolean external){
  HashSet<Node> graphNodesForParent=graphNodesForTreeNode.get(treeNode.getParent());
  TLongBipartition nodeBipart;
  TLongBipartition nodeBipartExp=null;
  if (external == false) {
    nodeBipart=bipartForTreeNode.get(treeNode);
    int bpid=bipartId.get(nodeBipart);
    if (USING_TAXONOMY)     nodeBipartExp=bipartForTreeNodeExploded.get(treeNode);
  }
 else {
    nodeBipart=getGraphBipartForTreeNode(treeNode,tree);
    if (USING_TAXONOMY)     nodeBipartExp=getExpandedTaxonomyBipart(nodeBipart);
  }
  HashSet<Node> graphNodes=new HashSet<Node>();
  HashSet<Node> taxNodesMatched=new HashSet<Node>();
  for (  Node parent : graphNodesForParent) {
    for (    Relationship r : parent.getRelationships(Direction.INCOMING,RelType.MRCACHILDOF)) {
      Node potentialChild=r.getStartNode();
      TLongBipartition childBipart;
      TLongBipartition childBipartExp=null;
      if (USING_TAXONOMY == false || taxonomyGraphNodesMap.containsKey(potentialChild) == false) {
        childBipart=bipartForGraphNode.get(potentialChild);
      }
 else {
        childBipart=taxonomyGraphNodesMap.get(potentialChild);
        childBipartExp=childBipart;
      }
      if (childBipart == null)       continue;
      if (taxonomyGraphNodesMap.containsKey(potentialChild) == false && taxonomyGraphNodesMap.containsKey(parent)) {
        childBipartExp=bipartForGraphNodeExploded.get(potentialChild);
      }
      if (USING_TAXONOMY && taxonomyGraphNodesMap.containsKey(parent)) {
        if (taxonomyGraphNodesMap.containsKey(potentialChild)) {
          if (parent.equals(potentialChild) == false && childBipartExp.ingroup().containsAll(nodeBipartExp.ingroup()) && childBipartExp.ingroup().containsAny(nodeBipartExp.outgroup()) == false && taxonomyGraphNodesMap.get(parent).ingroup().containsAll(childBipartExp.ingroup())) {
            graphNodes.add(potentialChild);
            taxNodesMatched.add(potentialChild);
            updateSTREEChildOf(potentialChild,parent,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
            boolean going=true;
            Node curchild=potentialChild;
            while (going) {
              going=false;
              for (              Relationship rc : curchild.getRelationships(RelType.TAXCHILDOF,Direction.INCOMING)) {
                Node tch=rc.getStartNode();
                if (taxonomyGraphNodesMap.containsKey(tch) == false)                 continue;
                TLongBipartition tchb=taxonomyGraphNodesMap.get(tch);
                if (parent.equals(tch) == false && tchb.ingroup().containsAll(nodeBipartExp.ingroup()) && tchb.ingroup().containsAny(nodeBipartExp.outgroup()) == false && taxonomyGraphNodesMap.get(parent).ingroup().containsAll(tchb.ingroup())) {
                  graphNodes.add(tch);
                  taxNodesMatched.add(tch);
                  updateSTREEChildOf(tch,curchild,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
                  going=true;
                  curchild=tch;
                  break;
                }
              }
            }
          }
        }
 else {
          if (childBipartExp.containsAll(nodeBipartExp) && taxonomyGraphNodesMap.get(parent).ingroup().containsAll(childBipartExp.ingroup()) && taxonomyGraphNodesMap.get(parent).ingroup().containsAny(childBipartExp.outgroup())) {
            graphNodes.add(potentialChild);
            updateSTREEChildOf(potentialChild,parent,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
          }
        }
      }
 else       if (USING_TAXONOMY && taxonomyGraphNodesMap.containsKey(potentialChild)) {
        if (childBipartExp.ingroup().containsAll(nodeBipartExp.ingroup()) && childBipartExp.ingroup().containsAny(nodeBipartExp.outgroup()) == false) {
          graphNodes.add(potentialChild);
          taxNodesMatched.add(potentialChild);
          updateSTREEChildOf(potentialChild,parent,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
          boolean going=true;
          Node curchild=potentialChild;
          while (going) {
            going=false;
            for (            Relationship rc : curchild.getRelationships(RelType.TAXCHILDOF,Direction.INCOMING)) {
              Node tch=rc.getStartNode();
              if (taxonomyGraphNodesMap.containsKey(tch) == false)               continue;
              TLongBipartition tchb=taxonomyGraphNodesMap.get(tch);
              if (tchb.ingroup().containsAll(nodeBipartExp.ingroup()) && tchb.ingroup().containsAny(nodeBipartExp.outgroup()) == false) {
                graphNodes.add(tch);
                taxNodesMatched.add(tch);
                updateSTREEChildOf(tch,curchild,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
                going=true;
                curchild=tch;
                break;
              }
            }
          }
        }
      }
 else {
        TLongBipartition testParent=bipartForGraphNode.get(parent);
        if (childBipart.containsAll(nodeBipart) && childBipart.isNestedPartitionOf(testParent)) {
          graphNodes.add(potentialChild);
          updateSTREEChildOf(potentialChild,parent,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
        }
      }
    }
  }
  for (  Node gn : taxNodesMatched) {
    for (    Relationship trel : gn.getRelationships(Direction.INCOMING,RelType.MRCACHILDOF)) {
      if (graphNodes.contains(trel.getStartNode())) {
        updateSTREEChildOf(trel.getStartNode(),gn,sourceForTreeNode.get(treeNode),rankForTreeNode.get(treeNode));
      }
    }
  }
  return graphNodes;
}