@Test
  public void testGetWALRootDirUsingUri() throws IOException {
    Path root = new Path("file:///hbase/root");
    conf.set(HConstants.HBASE_DIR, root.toString());
    Path walRoot = new Path("file:///hbase/logroot");
    conf.set(CommonFSUtils.HBASE_WAL_DIR, walRoot.toString());
    String walDirUri = CommonFSUtils.getDirUri(conf, walRoot);
    String rootDirUri = CommonFSUtils.getDirUri(conf, root);
    CommonFSUtils.setFsDefault(this.conf, rootDirUri);
    CommonFSUtils.setRootDir(conf, root);
    assertEquals(root, CommonFSUtils.getRootDir(conf));
    CommonFSUtils.setFsDefault(this.conf, walDirUri);
    CommonFSUtils.setWALRootDir(conf, walRoot);
    assertEquals(walRoot, CommonFSUtils.getWALRootDir(conf));
  }
Test path compare and prefix checking.
hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCommonFSUtils.java