NodeRetriever { public Node getNode(String path) throws PathNotFoundException, RepositoryException { return getNode(path, session.getRootNode()); } NodeRetriever(Session session); Node getNode(String path); Node getNode(String path, Node context);  }
@Test public void testAbsolutePath() throws Exception { final Node node = retriever.getNode("/foo/bar"); assertThat(node, notNullValue()); assertThat(node.getPath(), is("/foo/bar")); }
@Test public void testRelativePath() throws Exception { final Node fooNode = jcrSession.getRootNode().getNode("foo"); assertThat(fooNode, notNullValue()); final Node node = retriever.getNode("bar", fooNode); assertThat(node, notNullValue()); }