title: Test whether Path.relativize() would succeed?
body: <p>The method <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#relativize-java.nio.file.Path-" rel="nofollow"><code>java.nio.file.Path.relativize()</code></a> will throw <code>IllegalArgumentException</code> with some arguments.</p>
  
  <blockquote>
    <p>A relative path cannot be constructed if only one of the paths have a root component. Where both paths have a root component then it is implementation dependent if a relative path can be constructed.</p>
  </blockquote>
  
  <p>For example, on Windows, the method can fail if the two arguments refer to paths on different drives.</p>
  
  <p>Is there an OS-neutral way to test whether a particular argument is legal, <em>before</em> calling <code>Path.relativize()</code>, to avoid relying on an exception to handle a non-exceptional case?</p>