@Test
public void testSplitPathToNodes() throws IllegalPathException {

  assertEquals(Arrays.asList("root", "sg", "d1", "s1").toArray(),
      MetaUtils.splitPathToDetachedPath("root.sg.d1.s1"));
  assertEquals(Arrays.asList("root", "sg", "d1", "\"s.1\"").toArray(),
      MetaUtils.splitPathToDetachedPath("root.sg.d1.\"s.1\""));
  assertEquals(Arrays.asList("root", "sg", "d1", "\"s\\\".1\"").toArray(),
      MetaUtils.splitPathToDetachedPath("root.sg.d1.\"s\\\".1\""));
  assertEquals(Arrays.asList("root", "\"s g\"", "d1", "\"s.1\"").toArray(),
      MetaUtils.splitPathToDetachedPath("root.\"s g\".d1.\"s.1\""));
  assertEquals(Arrays.asList("root", "\"s g\"", "\"d_.1\"", "\"s.1.1\"").toArray(),
      MetaUtils.splitPathToDetachedPath("root.\"s g\".\"d_.1\".\"s.1.1\""));
  assertEquals(Arrays.asList("root", "1").toArray(), MetaUtils.splitPathToDetachedPath("root.1"));
  assertEquals(Arrays.asList("root", "sg", "d1", "s", "1").toArray(),
      MetaUtils.splitPathToDetachedPath("root.sg.d1.s.1"));
  try {
    MetaUtils.splitPathToDetachedPath("root.sg.\"d.1\"\"s.1\"");
  } catch (IllegalPathException e) {
    Assert.assertTrue(e.getMessage().contains("Illegal path: "));
  }
  try {
    MetaUtils.splitPathToDetachedPath("root.sg.d1.\'s1\'");
  } catch (IllegalPathException e) {
    Assert.assertTrue(e.getMessage().contains("Illegal path with single quote: "));
  }
}