class SplitHistory implements Comparable<SplitHistory>, Serializable {

    public boolean isSuccessor(SplitHistory history) {
        int ts = size();
        int ps = history.size();
        int last = -1;
        SplitHistoryEntry tn = null;
        SplitHistoryEntry pn = null;
        // walk along common path from root
        for (int i = 0; i < Math.min(ts, ps); i++) {
            last = i;
            tn = entries.get(i);
            pn = history.entries.get(i);
            if (tn.getIndex() != pn.getIndex()) {
                break;
            }
        }
        if (!tn.isSuccessor(pn)) {
            return false;
        }
        if (!isFirstUpTo(last)) {
            return false;
        }
        if (!history.isLastUpTo(last)) {
            return false;
        }
        return true;
        
    }

    public  SplitHistory();
    public  SplitHistory(int initialCapacity);
    private  SplitHistory(boolean addRoot);
    private  SplitHistory(int initialCapacity, boolean addRoot);

}