### Question:
AbstractPath implements Path { public Path relativeTo( Path startingPath ) { CheckArg.isNotNull(startingPath, "to"); if (!this.isAbsolute()) { String msg = GraphI18n.pathIsNotAbsolute.text(this); throw new InvalidPathException(msg); } if (startingPath.isRoot()) { return relativeToRoot(); } if (!startingPath.isAbsolute()) { String msg = GraphI18n.pathIsNotAbsolute.text(startingPath); throw new InvalidPathException(msg); } int lengthOfCommonAncestor = 0; Iterator<Segment> thisIter = this.getNormalizedPath().iterator(); Iterator<Segment> toIter = startingPath.getNormalizedPath().iterator(); while (thisIter.hasNext() && toIter.hasNext()) { Segment thisSeg = thisIter.next(); Segment toSeg = toIter.next(); if (thisSeg.equals(toSeg)) { ++lengthOfCommonAncestor; } else { break; } } int numberOfParentReferences = startingPath.size() - lengthOfCommonAncestor; List<Segment> relativeSegments = new ArrayList<Segment>(); for (int i = 0; i != numberOfParentReferences; ++i) { relativeSegments.add(Path.PARENT_SEGMENT); } for (int i = lengthOfCommonAncestor; i < this.size(); ++i) { relativeSegments.add(getSegment(i)); } if (relativeSegments.isEmpty()) { relativeSegments.add(Path.SELF_SEGMENT); } return new BasicPath(relativeSegments, false); }  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 = InvalidPathException.class ) public void shouldNotFindRelativePathToAnotherRelativePath() { Path other = mock(Path.class); when(other.isAbsolute()).thenReturn(false); path.relativeTo(other); }