Path { @Override public boolean equals(Object other) { if (other instanceof Path) { return getRelative().equals(((Path) other).getRelative()); } return false; } private  Path(String delimiter); private  Path(Path path); private  Path(List<String> elements, String delimiter); boolean isChildOf(Path parent); Path append(String path); Path append(Path path); String getName(); String getRelative(); Path getParentPath(); Path getChildPath(); String last(); Path withLast(String element); String getAbsolute(); boolean isRoot(); Iterator<String> iterator(); List<String> elements(); @Override String toString(); static Path fromString(String path); static Path fromString(String path, String delimiter); static Path createRoot(); static Path createRoot(String delimiter); File toFile(); @Override int hashCode(); @Override boolean equals(Object other);  }
@Test public void testEquals() { assertTrue(getAbsolutePath().equals(getAbsolutePath())); assertTrue(getAbsolutePath().equals(getRelativePath())); assertTrue(getAbsolutePath().equals(getWithSlashes())); assertTrue(getAbsolutePath().equals(getAppended())); assertFalse(getAbsolutePath().equals(getOne())); assertTrue(getRelativePath().equals(getAbsolutePath())); assertTrue(getRelativePath().equals(getRelativePath())); assertTrue(getRelativePath().equals(getWithSlashes())); assertTrue(getRelativePath().equals(getAppended())); assertFalse(getRelativePath().equals(getOne())); assertTrue(getWithSlashes().equals(getAbsolutePath())); assertTrue(getWithSlashes().equals(getRelativePath())); assertTrue(getWithSlashes().equals(getWithSlashes())); assertTrue(getWithSlashes().equals(getAppended())); assertFalse(getWithSlashes().equals(getOne())); assertTrue(getAppended().equals(getAbsolutePath())); assertTrue(getAppended().equals(getRelativePath())); assertTrue(getAppended().equals(getWithSlashes())); assertTrue(getAppended().equals(getAppended())); assertFalse(getAppended().equals(getOne())); assertFalse(getOne().equals(getAbsolutePath())); assertFalse(getOne().equals(getRelativePath())); assertFalse(getOne().equals(getWithSlashes())); assertFalse(getOne().equals(getAppended())); assertTrue(getOne().equals(getOne())); }