### Question:
PathService implements Comparator<JimfsPath> { @Override public int compare(JimfsPath a, JimfsPath b) { return ComparisonChain.start() .compare(a.root(), b.root(), rootOrdering) .compare(a.names(), b.names(), namesOrdering) .result(); } PathService(Configuration config);   PathService(
      PathType type,
      Iterable<PathNormalization> displayNormalizations,
      Iterable<PathNormalization> canonicalNormalizations,
      boolean equalityUsesCanonicalForm); void setFileSystem(FileSystem fileSystem); FileSystem getFileSystem(); String getSeparator(); JimfsPath emptyPath(); Name name(String name); JimfsPath createRoot(Name root); JimfsPath createFileName(Name name); JimfsPath createRelativePath(Iterable<Name> names); JimfsPath createPath(@NullableDecl Name root, Iterable<Name> names); JimfsPath parsePath(String first, String... more); String toString(JimfsPath path); int hash(JimfsPath path); @Override int compare(JimfsPath a, JimfsPath b); URI toUri(URI fileSystemUri, JimfsPath path); JimfsPath fromUri(URI uri); PathMatcher createPathMatcher(String syntaxAndPattern);  }### Answer:
@Test public void testCompareTo_usingDisplayForm() { PathService pathService = fakePathService(PathType.unix(), false); JimfsPath path1 = new JimfsPath(pathService, null, ImmutableList.of(Name.create("a", "z"))); JimfsPath path2 = new JimfsPath(pathService, null, ImmutableList.of(Name.create("b", "y"))); JimfsPath path3 = new JimfsPath(pathService, null, ImmutableList.of(Name.create("c", "x"))); assertThat(pathService.compare(path1, path2)).isEqualTo(-1); assertThat(pathService.compare(path2, path3)).isEqualTo(-1); }
@Test public void testCompareTo_usingCanonicalForm() { PathService pathService = fakePathService(PathType.unix(), true); JimfsPath path1 = new JimfsPath(pathService, null, ImmutableList.of(Name.create("a", "z"))); JimfsPath path2 = new JimfsPath(pathService, null, ImmutableList.of(Name.create("b", "y"))); JimfsPath path3 = new JimfsPath(pathService, null, ImmutableList.of(Name.create("c", "x"))); assertThat(pathService.compare(path1, path2)).isEqualTo(1); assertThat(pathService.compare(path2, path3)).isEqualTo(1); }