class SplitHistory implements Comparable<SplitHistory>, Serializable {

    public static SplitHistory parse(String history) {
        if (!history.matches(PATTERN)) {
            throw new SplitHistoryFormatException("History '" + history + "' doesn't match pattern '" + PATTERN + "'");
        }
        String p = history.substring(1, history.length() - 1);
        String[] na = p.split(",");
        SplitHistory result = new SplitHistory(na.length + 2, false);
        for (int i = 0; i < na.length; i++) {
            SplitHistoryEntry n = SplitHistoryEntry.parse(na[i].trim());
            if (i == 0) {
                validateRoot(n);
            }
            result.entries.add(n);
        }
        return result;
    }

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

}