@Test
public void testUnnestUri() throws Exception {

  assertEquals(new Path("hdfs://nn.example.com/my/path"),
      KeyProvider.unnestUri(new URI("myscheme://hdfs@nn.example.com/my/path")));
  assertEquals(new Path("hdfs://nn/my/path?foo=bar&baz=bat#yyy"),
      KeyProvider.unnestUri(new URI("myscheme://hdfs@nn/my/path?foo=bar&baz=bat#yyy")));
  assertEquals(new Path("inner://hdfs@nn1.example.com/my/path"),
      KeyProvider.unnestUri(new URI("outer://inner@hdfs@nn1.example.com/my/path")));
  assertEquals(new Path("user:///"),
      KeyProvider.unnestUri(new URI("outer://user/")));
}