### Question:
AbstractPath implements Path { public Iterator<Segment> iterator() { return getSegmentsList().iterator(); }  boolean isIdentifier(); Path getCanonicalPath(); Path getCommonAncestor( Path that ); Path.Segment getLastSegment(); boolean endsWith( Name nameOfLastSegment ); boolean endsWith( Name nameOfLastSegment,
                             int snsIndex ); Path getParent(); Segment getSegment( int index ); Segment[] getSegmentsArray(); Path getNormalizedPath(); String getString(); String getString( TextEncoder encoder ); String getString( NamespaceRegistry namespaceRegistry ); String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder ); String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder,
                             TextEncoder delimiterEncoder ); boolean hasSameAncestor( Path that ); boolean isAncestorOf( Path decendant ); boolean isAtOrBelow( Path other ); boolean isAtOrAbove( Path other ); boolean isDecendantOf( Path ancestor ); boolean isSameAs( Path other ); Iterator<Segment> iterator(); Iterator<Path> pathsFromRoot(); Path relativeToRoot(); Path relativeTo( Path startingPath ); Path resolve( Path relativePath ); Path resolveAgainst( Path absolutePath ); Path subpath( int beginIndex ); Path subpath( int beginIndex,
                         int endIndex ); @Override int hashCode(); @Override boolean equals( Object obj ); int compareTo( Path that ); @Override String toString(); static final Path SELF_PATH; }### Answer:
@Test( expected = UnsupportedOperationException.class ) public void shouldReturnImmutableSegmentsIterator() { Iterator<Segment> iter = path.iterator(); if (iter.hasNext()) { iter.remove(); } }
@Test public void shouldReturnNonNullIteratorOverSegments() { assertThat(path.iterator(), is(notNullValue())); }