@Test (timeout = 30000)
public void testMergePaths() {

  assertEquals(new Path("/foo/bar"),
    Path.mergePaths(new Path("/foo"),
      new Path("/bar")));
  assertEquals(new Path("/foo/bar/baz"),
    Path.mergePaths(new Path("/foo/bar"),
      new Path("/baz")));
  assertEquals(new Path("/foo/bar/baz"),
    Path.mergePaths(new Path("/foo"),
      new Path("/bar/baz")));
  assertEquals(new Path(Shell.WINDOWS ? "/C:/foo/bar" : "/C:/foo/C:/bar"),
    Path.mergePaths(new Path("/C:/foo"),
      new Path("/C:/bar")));
  assertEquals(new Path(Shell.WINDOWS ? "/C:/bar" : "/C:/C:/bar"),
      Path.mergePaths(new Path("/C:/"),
        new Path("/C:/bar")));
  assertEquals(new Path("/bar"),
      Path.mergePaths(new Path("/"), new Path("/bar")));
  assertEquals(new Path("viewfs:///foo/bar"),
    Path.mergePaths(new Path("viewfs:///foo"),
      new Path("file:///bar")));
  assertEquals(new Path("viewfs://vfsauthority/foo/bar"),
    Path.mergePaths(new Path("viewfs://vfsauthority/foo"),
      new Path("file://fileauthority/bar")));
}