RootPath extends AbstractPath { @Override public boolean isDescendantOf( Path ancestor ) { CheckArg.isNotNull(ancestor, "ancestor"); return false; } private  RootPath(); @Override Path getAncestor( int degree ); @Override Path getCanonicalPath(); @Override Path getCommonAncestor( Path that ); @Override Segment getLastSegment(); @Override boolean endsWith( Name nameOfLastSegment ); @Override boolean endsWith( Name nameOfLastSegment,
                             int snsIndex ); @Override Path getNormalizedPath(); @Override Path relativeToRoot(); @Override Path resolve( Path relativePath ); @Override Path getParent(); @Override Segment getSegment( int index ); @Override Segment[] getSegmentsArray(); @Override List<Segment> getSegmentsList(); @Override String getString(); @Override String getString( TextEncoder encoder ); @Override String getString( NamespaceRegistry namespaceRegistry ); @Override String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder ); @Override String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder,
                             TextEncoder delimiterEncoder ); @Override boolean hasSameAncestor( Path that ); @Override boolean isAbsolute(); @Override boolean isAncestorOf( Path descendant ); @Override boolean isAtOrAbove( Path other ); @Override boolean isAtOrBelow( Path other ); @Override boolean isDescendantOf( Path ancestor ); @Override boolean isNormalized(); @Override boolean isRoot(); @Override boolean isSameAs( Path other ); @Override Iterator<Segment> iterator(); @Override Iterator<Path> pathsFromRoot(); @Override int size(); @Override Path subpath( int beginIndex ); @Override Path subpath( int beginIndex,
                         int endIndex ); @Override int compareTo( Path other ); @Override boolean equals( Object obj ); @Override int hashCode(); static final Path INSTANCE; }
@Test public void shouldNotConsiderRootNodeToBeDecendantOfAnyNode() { Path other = mock(Path.class); assertThat(root.isDescendantOf(other), is(false)); assertThat(root.isDescendantOf(root), is(false)); }