### Question:
JcrObservationManager implements ObservationManager { ValueFactories getValueFactories() { return this.valueFactories; } JcrObservationManager( JcrSession session,
                           Observable repositoryObservable ); synchronized void addEventListener( EventListener listener,
                                               int eventTypes,
                                               String absPath,
                                               boolean isDeep,
                                               String[] uuid,
                                               String[] nodeTypeName,
                                               boolean noLocal ); EventListenerIterator getRegisteredEventListeners(); synchronized void removeEventListener( EventListener listener ); @Override void setUserData( String userData ); @Override EventJournal getEventJournal(); @Override EventJournal getEventJournal( int eventTypes,
                                         String absPath,
                                         boolean isDeep,
                                         String[] uuid,
                                         String[] nodeTypeName );  }### Answer:
@Test public void shouldTestEventIteratorTest_testSkip() throws Exception { List<Event> events = new ArrayList<Event>(); DateTime now = engine.getExecutionContext().getValueFactories().getDateFactory().create(); JcrEventBundle bundle = ((JcrObservationManager)getObservationManager()).new JcrEventBundle(now, "userId", null); String id1 = UUID.randomUUID().toString(); String id2 = UUID.randomUUID().toString(); String id3 = UUID.randomUUID().toString(); events.add(((JcrObservationManager)getObservationManager()).new JcrEvent(bundle, Event.NODE_ADDED, "/testroot/node1", id1)); events.add(((JcrObservationManager)getObservationManager()).new JcrEvent(bundle, Event.NODE_ADDED, "/testroot/node2", id2)); events.add(((JcrObservationManager)getObservationManager()).new JcrEvent(bundle, Event.NODE_ADDED, "/testroot/node3", id3)); EventIterator itr = ((JcrObservationManager)getObservationManager()).new JcrEventIterator(events); itr.skip(0); assertThat("getPosition() for first element should return 0.", itr.getPosition(), is(0L)); itr.skip(2); assertThat("Wrong value when skipping ", itr.getPosition(), is(2L)); try { itr.skip(2); fail("EventIterator must throw NoSuchElementException when skipping past the end"); } catch (NoSuchElementException e) { } }