public Entry next(Entry object) {
   if (object == null) {
     Node<Comparable<Comparable>> firstNode = tree.first();
     return firstNode == null ? null : firstNode.getFirst();
   }
   LeftTuple leftTuple = (LeftTuple) object;
   LeftTuple next = (LeftTuple) leftTuple.getNext();
   if (next != null) {
     return next;
   }
   Comparable key = getIndexedValue(leftTuple);
   return getNext(key, false);
 }
  public Entry[] toArray() {
    FastIterator it = tree.fastIterator();
    if (it == null) {
      return new Entry[0];
    }

    List<Comparable> toBeRemoved = new ArrayList<Comparable>();
    List<LeftTuple> result = new ArrayList<LeftTuple>();

    LeftTupleList list = null;
    while ((list = (LeftTupleList) it.next(list)) != null) {
      LeftTuple entry = list.getFirst();
      while (entry != null) {
        result.add(entry);
        entry = (LeftTuple) entry.getNext();
      }
    }

    return result.toArray(new LeftTuple[result.size()]);
  }