Program: 125205
Project: 125205
Buggy source:
void addExtraBipartitionsByInput(Map<Integer,Set<Vertex>> clusters,List<Tree> trees,TaxonNameMap taxonMap,boolean extraTreeRooted){
  int sigmaN=0;
  int k=trees.size();
  String[] leaves=stTaxa;
  int n=leaves.length;
  STITreeCluster all=clusters.get(n).iterator().next()._cluster;
  for (  Tree tr : trees) {
    String[] treeLeaves=tr.getLeaves();
    STITreeCluster treeAll=new STITreeCluster(leaves);
    for (int i=0; i < treeLeaves.length; i++) {
      treeAll.addLeaf(treeLeaves[i]);
    }
    sigmaN+=tr.getLeafCount() - 1;
    Map<TNode,STITreeCluster> map=new HashMap<TNode,STITreeCluster>(n);
    for (Iterator<TNode> nodeIt=tr.postTraverse().iterator(); nodeIt.hasNext(); ) {
      TNode node=nodeIt.next();
      if (node.isLeaf()) {
        String nodeName=node.getName();
        if (taxonMap != null) {
          nodeName=taxonMap.getTaxonName(nodeName);
        }
        STITreeCluster tb=new STITreeCluster(leaves);
        tb.addLeaf(nodeName);
        map.put(node,tb);
        if (!extraTreeRooted) {
          addSTBToX(clusters,tb,treeComplementary(treeAll,tb),null,node);
        }
      }
 else {
        int childCount=node.getChildCount();
        STITreeCluster childbslist[]=new STITreeCluster[childCount];
        BitSet bs=new BitSet(leaves.length);
        int index=0;
        for (Iterator iterator3=node.getChildren().iterator(); iterator3.hasNext(); ) {
          TNode child=(TNode)iterator3.next();
          childbslist[index++]=map.get(child);
          bs.or(map.get(child).getCluster());
        }
        STITreeCluster cluster=new STITreeCluster(leaves);
        cluster.setCluster((BitSet)bs.clone());
        int size=cluster.getClusterSize();
        map.put(node,cluster);
        if (extraTreeRooted) {
          if (index > 2) {
            throw new RuntimeException("String_Node_Str" + tr + "String_Node_Str"+ node);
          }
          STITreeCluster l_cluster=childbslist[0];
          STITreeCluster r_cluster=childbslist[1];
          addSTBToX(clusters,l_cluster,r_cluster,cluster,node);
        }
 else {
          if (childCount == 2) {
            STITreeCluster l_cluster=childbslist[0];
            STITreeCluster r_cluster=childbslist[1];
            STITreeCluster allMinuslAndr_cluster=treeComplementary(treeAll,cluster);
            STITreeCluster lAndr_cluster=cluster;
            addSTBToX(clusters,l_cluster,r_cluster,cluster,node);
            if (allMinuslAndr_cluster.getClusterSize() != 0) {
              addSTBToX(clusters,r_cluster,allMinuslAndr_cluster,null,node);
              addSTBToX(clusters,l_cluster,allMinuslAndr_cluster,null,node);
              addSTBToX(clusters,lAndr_cluster,allMinuslAndr_cluster,all,node);
            }
          }
 else           if (childCount == 3 && node.isRoot()) {
            STITreeCluster l_cluster=childbslist[0];
            STITreeCluster m_cluster=childbslist[1];
            STITreeCluster r_cluster=childbslist[2];
            addSTBToX(clusters,l_cluster,r_cluster,null,node);
            addSTBToX(clusters,r_cluster,m_cluster,null,node);
            addSTBToX(clusters,l_cluster,m_cluster,null,node);
          }
 else {
            throw new RuntimeException("String_Node_Str" + tr + "String_Node_Str"+ node);
          }
        }
      }
    }
  }
  int s=0;
  for (  Integer c : clusters.keySet()) {
    s+=clusters.get(c).size();
  }
  System.out.println("String_Node_Str" + s);
  System.out.println("String_Node_Str" + STBCountInGeneTrees.size());
}

Fixed version (ground truth):
void addExtraBipartitionsByInput(Map<Integer,Set<Vertex>> clusters,List<Tree> trees,TaxonNameMap taxonMap,boolean extraTreeRooted){
  int sigmaN=0;
  int k=trees.size();
  String[] leaves=stTaxa;
  int n=leaves.length;
  STITreeCluster all=clusters.get(n).iterator().next()._cluster;
  for (  Tree tr : trees) {
    String[] treeLeaves=tr.getLeaves();
    STITreeCluster treeAll=new STITreeCluster(leaves);
    for (int i=0; i < treeLeaves.length; i++) {
      treeAll.addLeaf(treeLeaves[i]);
    }
    sigmaN+=tr.getLeafCount() - 1;
    Map<TNode,STITreeCluster> map=new HashMap<TNode,STITreeCluster>(n);
    for (Iterator<TNode> nodeIt=tr.postTraverse().iterator(); nodeIt.hasNext(); ) {
      TNode node=nodeIt.next();
      if (node.isLeaf()) {
        String nodeName=node.getName();
        if (taxonMap != null) {
          nodeName=taxonMap.getTaxonName(nodeName);
        }
        STITreeCluster tb=new STITreeCluster(leaves);
        tb.addLeaf(nodeName);
        map.put(node,tb);
        if (!extraTreeRooted) {
          addSTBToX(clusters,tb,treeComplementary(treeAll,tb),null,node);
        }
      }
 else {
        int childCount=node.getChildCount();
        STITreeCluster childbslist[]=new STITreeCluster[childCount];
        BitSet bs=new BitSet(leaves.length);
        int index=0;
        for (Iterator iterator3=node.getChildren().iterator(); iterator3.hasNext(); ) {
          TNode child=(TNode)iterator3.next();
          childbslist[index++]=map.get(child);
          bs.or(map.get(child).getCluster());
        }
        STITreeCluster cluster=new STITreeCluster(leaves);
        cluster.setCluster((BitSet)bs.clone());
        int size=cluster.getClusterSize();
        map.put(node,cluster);
        if (extraTreeRooted) {
          if (index > 2) {
            throw new RuntimeException("String_Node_Str" + tr + "String_Node_Str"+ node);
          }
          STITreeCluster l_cluster=childbslist[0];
          STITreeCluster r_cluster=childbslist[1];
          addSTBToX(clusters,l_cluster,r_cluster,cluster,node);
        }
 else {
          if (childCount == 2) {
            STITreeCluster l_cluster=childbslist[0];
            STITreeCluster r_cluster=childbslist[1];
            STITreeCluster allMinuslAndr_cluster=treeComplementary(treeAll,cluster);
            STITreeCluster lAndr_cluster=cluster;
            addSTBToX(clusters,l_cluster,r_cluster,cluster,node);
            if (allMinuslAndr_cluster.getClusterSize() != 0) {
              addSTBToX(clusters,r_cluster,allMinuslAndr_cluster,null,node);
              addSTBToX(clusters,l_cluster,allMinuslAndr_cluster,null,node);
              addSTBToX(clusters,lAndr_cluster,allMinuslAndr_cluster,all,node);
            }
          }
 else           if (childCount == 3 && node.isRoot()) {
            STITreeCluster l_cluster=childbslist[0];
            STITreeCluster m_cluster=childbslist[1];
            STITreeCluster r_cluster=childbslist[2];
            addSTBToX(clusters,l_cluster,r_cluster,null,node);
            addSTBToX(clusters,r_cluster,m_cluster,null,node);
            addSTBToX(clusters,l_cluster,m_cluster,null,node);
          }
 else {
            throw new RuntimeException("String_Node_Str" + tr + "String_Node_Str"+ node);
          }
        }
      }
    }
  }
  int s=0;
  for (  Integer c : clusters.keySet()) {
    s+=clusters.get(c).size();
  }
  System.err.println("String_Node_Str" + s);
  System.err.println("String_Node_Str" + STBCountInGeneTrees.size());
}