JcrEmptyNodeIterator implements NodeIterator { @Override public Object next() { throw new NoSuchElementException(); } private  JcrEmptyNodeIterator(); @Override Node nextNode(); @Override long getPosition(); @Override long getSize(); @Override void skip( long skipNum ); @Override boolean hasNext(); @Override Object next(); @Override void remove();  }
@Test( expected = NoSuchElementException.class ) public void shouldFailWhenNextIsCalled() { iter.next(); }