NodePath extends ComponentSupport { @Nullable public NodePath parent() { int i = path.lastIndexOf(Node.SEPARATOR); if (i == 0) { return this; } else if (i == -1) { return null; } else { return new NodePath(path.substring(0, i)); } } NodePath(final String path); boolean isAbsolute(); String first(); String last(); @Nullable NodePath parent(); NodePath child(final String name); NodePath normalize(); String[] split(); @Override int hashCode(); @Override String toString();  }
@Test public void testParent4() { assertNull(new NodePath("..").parent()); }
@Test public void testParent5() { assertNull(new NodePath("foo").parent()); }