IdPath { @Override public boolean equals(Object o) { if (o == null || !o.getClass().equals(getClass())) return false; return Arrays.equals(myParts, ((IdPath)o).myParts); } IdPath(int... parts);  IdPath(Stream s); void write(Stream s); int getId(); IdPath getParent(); IdPath appendedWith(int id); boolean isChildOrParentOf(IdPath p); boolean contains(int id); boolean startsWith(IdPath p); boolean rootEquals(int id); IdPath withoutRoot(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquality() { assertTrue(new IdPath(1, 2, 3).equals(new IdPath(1, 2, 3))); assertFalse(new IdPath(1, 2, 3).equals(new IdPath(1, 2))); assertFalse(new IdPath(1, 2, 3).equals(null)); assertFalse(new IdPath(1, 2, 3).equals(new Object())); }