@Test
  public void testToUri() {
    URI fileUri = type.toUri(fileSystemUri, "$", ImmutableList.of("foo", "bar"), false);
    assertThat(fileUri.toString()).isEqualTo("jimfs://foo/$/foo/bar");
    assertThat(fileUri.getPath()).isEqualTo("/$/foo/bar");

    URI directoryUri = type.toUri(fileSystemUri, "$", ImmutableList.of("foo", "bar"), true);
    assertThat(directoryUri.toString()).isEqualTo("jimfs://foo/$/foo/bar/");
    assertThat(directoryUri.getPath()).isEqualTo("/$/foo/bar/");

    URI rootUri = type.toUri(fileSystemUri, "$", ImmutableList.<String>of(), true);
    assertThat(rootUri.toString()).isEqualTo("jimfs://foo/$/");
    assertThat(rootUri.getPath()).isEqualTo("/$/");
  }
Tests for {@link PathType}.

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