### Question:
Path implements Iterable<String>, Serializable { public Path getParent() { if (this.length() > 0) { return getSubPath(0, this.length() - 1); } else { return null; } } Path();  Path(String pathStr); private  Path(String[] elements, String pathStr); Path getParent(); Path getSubPath(int fromPosition); Path getSubPath(int fromPosition, int length); int length(); Iterator<String> iterator(); Collection<String> getElements(); String getElement(int index); String getLastElement(); String toString(); String getPathString(); int hashCode(); boolean equals(Object obj); static Path parse(String pathStr); static String getPathString(Path path); static Path concat(Path... paths); static String toPathString(List<String> listOfStrings); static String toPathString(String[] strings); static final String THIS_PATH_ELEMENT; static final String PATH_SEPARATOR; static final char PATH_SEPARATOR_CHAR; }### Answer:
@Test public void getParent() { Path path = new Path("this.a.b.c"); Path parent = path.getParent(); assertEquals("parent.toString()", "this.a.b", parent.toString()); parent = parent.getParent(); assertEquals("parent.toString()", "this.a", parent.toString()); parent = parent.getParent(); assertEquals("parent.toString()", "this", parent.toString()); parent = parent.getParent(); assertNull("parent", parent); }