AbstractPath implements Path { @Override public Segment[] getSegmentsArray() { Segment[] result = new Path.Segment[size()]; int i = 0; for (Segment segment : this) { result[i] = segment; ++i; } return result; }  @Override boolean isIdentifier(); @Override Path getCanonicalPath(); @Override Path getCommonAncestor( Path that ); @Override Path.Segment getLastSegment(); @Override boolean endsWith( Name nameOfLastSegment ); @Override boolean endsWith( Name nameOfLastSegment,
                             int snsIndex ); @Override Path getParent(); @Override Segment getSegment( int index ); @Override Segment[] getSegmentsArray(); @Override Path getNormalizedPath(); @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 isAncestorOf( Path descendant ); @Override boolean isAtOrBelow( Path other ); @Override boolean isAtOrAbove( Path other ); @Override boolean isDescendantOf( Path ancestor ); @Override boolean isSameAs( Path other ); @Override Iterator<Segment> iterator(); @Override Iterator<Path> pathsFromRoot(); @Override Path relativeToRoot(); @Override Path relativeTo( Path startingPath ); @Override Path resolve( Path relativePath ); @Override Path resolveAgainst( Path absolutePath ); @Override Path subpath( int beginIndex ); @Override Path subpath( int beginIndex,
                         int endIndex ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override int compareTo( Path that ); @Override String toString(); static final Path SELF_PATH; }
@Test public void shouldReturnNonNullSegmentsArray() { assertThat(path.getSegmentsArray(), is(notNullValue())); }