@Test
public void testNext() throws Exception {

    NodeIterator delegate = mock(NodeIterator.class);
    NodeIteratorFacade<Session> facade = getFacade(delegate);
    final Node value = mock(Node.class);
    final String path = "/correct/path";
    when(value.getPath()).thenReturn(path);
    when(delegate.nextNode()).thenReturn(value);
    final Object fromFacade = facade.next();
    assertTrue("is node", fromFacade instanceof Node);
    final Node nodeFromFacade = (Node) fromFacade;
    assertEquals("same path", path, nodeFromFacade.getPath());
    assertTrue("is facade", nodeFromFacade instanceof NodeFacade);
}