### Question:
PathComparator implements Comparator<String> { @Override public int compare(String path1, String path2) { List<String> segments1 = Splitter.on('/').splitToList(path1); List<String> segments2 = Splitter.on('/').splitToList(path2); return PathUtils.compare(segments1, segments2); }  @Override int compare(String path1, String path2);  }### Answer:
@Test public void test() { assertEquals(new PathComparator().compare("a/b", "b"), -1); assertEquals(new PathComparator().compare("a", "b"), -1); assertEquals(new PathComparator().compare("a/c", "a"), 1); assertEquals(new PathComparator().compare("abc", "ab/c"), 1); assertEquals(new PathComparator().compare("a/b/c", "a/b/c"), 0); assertEquals(new PathComparator().compare("a/b/c/d", "a/b/c"), 1); }