SplitHistory implements Comparable<SplitHistory>, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SplitHistory)) { return false; } SplitHistory p = (SplitHistory)obj; return entries.equals(p.entries); } 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 public void testEquals() { SplitHistory history1 = SplitHistory.parse("[(0/1)]"); SplitHistory history2 = SplitHistory.parse("[(0/1),(1/3)]"); assertFalse(history1.equals(history2)); assertTrue(history1.equals(history1)); assertFalse(history1.equals(history1.toString())); assertFalse(history1.equals(null)); assertTrue(history1.equals(new SplitHistory())); }