### Question:
Path implements Iterable<String>, Serializable { @Override public String toString() { return path; } Path(String path);  Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); boolean isAbsolute(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); Iterator<String> iterator(); String getName(); boolean isAncestorOf(Path other); boolean isDescendantOf(Path other); boolean isParentOf(Path other); boolean isChildOf(Path other); int size(); Path parent(); String part(int index); Path subpath(int idx); Path toAbsolute(); Path append(Path relative); Path toRelative(Path ancestor); static final Path ROOT; static final Comparator<Path> SMALLEST_FIRST_COMPARATOR; static final Comparator<Path> LARGEST_FIRST_COMPARATOR; }### Answer:
@Test public void construction() { assertEquals(new Path("/").toString(), "/"); assertEquals(new Path("/foo").toString(), "/foo"); assertEquals(new Path("/foo/").toString(), "/foo"); assertEquals(new Path("/foo/bar").toString(), "/foo/bar"); assertEquals(new Path("/foo/bar/").toString(), "/foo/bar"); assertEquals(new Path("foo").toString(), "foo"); assertEquals(new Path("foo/").toString(), "foo"); assertEquals(new Path("foo/bar").toString(), "foo/bar"); assertEquals(new Path("foo/bar/").toString(), "foo/bar"); try { new Path(""); fail(); } catch (IllegalArgumentException e) { } try { new Path(null); fail(); } catch (IllegalArgumentException e) { } }