@Test
  public void testPaths_relativize() {
    assertThatPath(path("C:\\foo\\bar").relativize(path("C:\\foo\\bar\\baz")))
        .isRelative()
        .and()
        .hasNameComponents("baz");
    assertThatPath(path("C:\\foo\\bar\\baz").relativize(path("C:\\foo\\bar")))
        .isRelative()
        .and()
        .hasNameComponents("..");
    assertThatPath(path("C:\\foo\\bar\\baz").relativize(path("C:\\foo\\baz\\bar")))
        .isRelative()
        .and()
        .hasNameComponents("..", "..", "baz", "bar");
    assertThatPath(path("foo\\bar").relativize(path("foo")))
        .isRelative()
        .and()
        .hasNameComponents("..");
    assertThatPath(path("foo").relativize(path("foo\\bar")))
        .isRelative()
        .and()
        .hasNameComponents("bar");

    try {
      Path unused = path("C:\\foo\\bar").relativize(path("bar"));
      fail();
    } catch (IllegalArgumentException expected) {
    }

    try {
      Path unused = path("bar").relativize(path("C:\\foo\\bar"));
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }
Tests a Windows-like file system through the public methods in {@link Files}.

@author Colin Decker
jimfs/src/test/java/com/google/common/jimfs/JimfsWindowsLikeFileSystemTest.java