### Question:
TreePath implements Comparable<TreePath>, Serializable { @Override public boolean equals(Object o) { if (!(o instanceof TreePath)) { return false; } TreePath other = (TreePath) o; return this.pathLength == other.pathLength && this.leftRight == other.leftRight; } private  TreePath(long leftRight, int pathLength); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); @Override int compareTo(TreePath o);  }### Answer:
@Test public void testEquals() { assertEquals(LRL, TreePath.EMPTY.extendLeft().extendRight().extendLeft()); assertNotEquals(TreePath.EMPTY, LRL); Collection<TreePath> paths = new HashSet<>(); paths.add(LRL); paths.add(LRR); paths.add(LRR); assertEquals(2, paths.size()); }