@Test public void testGetParent() throws Exception { Path path; path = Path.fromDotString("1.2.3"); Assert.assertThat(path.getParent(), is(Path.fromDotString("1.2"))); path = Path.fromDotString("1"); Assert.assertThat(path.getParent(), is(Path.fromDotString(""))); path = Path.fromDotString(""); Assert.assertThat(path.getParent(), nullValue()); }
@Test public void testGetParentOnEmptyPath() throws Exception { Path path = Path.fromDotString(""); Assert.assertThat(path.getParent(), nullValue()); }