@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); }
@Override public Object next() { return nextNode(); }
NodeIteratorFacade extends RangeIteratorFacade<NodeIterator> implements NodeIterator { @Override public Object next() { return nextNode(); } }
NodeIteratorFacade extends RangeIteratorFacade<NodeIterator> implements NodeIterator { @Override public Object next() { return nextNode(); } NodeIteratorFacade(final @NotNull NodeIterator delegate,
                              final @NotNull SessionFacade<S> session); }
NodeIteratorFacade extends RangeIteratorFacade<NodeIterator> implements NodeIterator { @Override public Object next() { return nextNode(); } NodeIteratorFacade(final @NotNull NodeIterator delegate,
                              final @NotNull SessionFacade<S> session); @Override Node nextNode(); @Override Object next(); }
NodeIteratorFacade extends RangeIteratorFacade<NodeIterator> implements NodeIterator { @Override public Object next() { return nextNode(); } NodeIteratorFacade(final @NotNull NodeIterator delegate,
                              final @NotNull SessionFacade<S> session); @Override Node nextNode(); @Override Object next();  }