private BdynRangeSet pruneRange(BdynRangeSet rslt, long t0, long t1) {
    if (rslt == null) return null;

    for (Iterator<Set<BdynEntry>> it = rslt.values().iterator(); it.hasNext(); ) {
      Set<BdynEntry> vals = it.next();
      int ct = 0;
      for (Iterator<BdynEntry> it1 = vals.iterator(); it1.hasNext(); ) {
        BdynEntry oe = it1.next();
        if (oe.getEndTime(t1) < t0) it1.remove();
        else ++ct;
      }
      if (ct == 0) it.remove();
    }

    if (rslt.size() == 0) return null;

    return rslt;
  }
  private BdynRangeSet addToRange(long start, long t0, long t1, BdynRangeSet rslt) {
    OutputEntry timee = new OutputEntry(start);
    SortedSet<OutputEntry> ss = output_set.tailSet(timee);
    for (OutputEntry e1 : ss) {
      if (e1.getStartTime() > t1) break;
      if (e1.getEndTime(t1) >= t0) {
        ThreadData td = e1.getThread();
        if (rslt == null) rslt = new BdynRangeSet();
        Set<BdynEntry> r1 = rslt.get(td);
        if (r1 == null) {
          r1 = new HashSet<BdynEntry>();
          rslt.put(td, r1);
        }
        r1.add(e1);
      }
    }

    return rslt;
  }