SplitHistory implements Comparable<SplitHistory>, Serializable { public boolean isFirstUpTo(int level) { if ((entries.size() - level) < 1) { throw new IllegalArgumentException("level must be less than entries size"); } for (int i = entries.size() - 1; i > level; i--) { if (!entries.get(i).isFirst()) { return false; } } return true; } SplitHistory();  SplitHistory(int initialCapacity); private  SplitHistory(boolean addRoot); private  SplitHistory(int initialCapacity, boolean addRoot); int size(); List<SplitHistoryEntry> entries(); int[] indexPath(); String indexPathString(); SplitHistory[] split(int num); SplitHistory split(int index, boolean last); @Override int compareTo(SplitHistory history); boolean isPredecessor(SplitHistory history); boolean isSuccessor(SplitHistory history); boolean isFirstUpTo(int level); boolean isLastUpTo(int level); boolean isFirst(); boolean isLast(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static SplitHistory parse(String history); static final SplitHistory ROOT; }
@Test(expected = IllegalArgumentException.class) public void isFirstUpTo() { int level = 3; assertTrue(historySplit[2].size() == 2); historySplit[2].isFirstUpTo(level); }