### Question:
IteratorImpl { public void next() { this.currEntry = null; if (this.currentIndex <= this.committedIndex) { ++this.currentIndex; if (this.currentIndex <= this.committedIndex) { try { this.currEntry = this.logManager.getEntry(this.currentIndex); if (this.currEntry == null) { getOrCreateError().setType(EnumOutter.ErrorType.ERROR_TYPE_LOG); getOrCreateError().getStatus().setError(-1, "Fail to get entry at index=%d while committed_index=%d", this.currentIndex, this.committedIndex); } } catch (final LogEntryCorruptedException e) { getOrCreateError().setType(EnumOutter.ErrorType.ERROR_TYPE_LOG); getOrCreateError().getStatus().setError(RaftError.EINVAL, e.getMessage()); } this.applyingIndex.set(this.currentIndex); } } } IteratorImpl(final StateMachine fsm, final LogManager logManager, final List<Closure> closures,
                        final long firstClosureIndex, final long lastAppliedIndex, final long committedIndex,
                        final AtomicLong applyingIndex); @Override String toString(); LogEntry entry(); RaftException getError(); boolean isGood(); boolean hasError(); void next(); long getIndex(); Closure done(); void setErrorAndRollback(final long ntail, final Status st);  }### Answer:
@Test public void testNext() { int i = 1; while (iter.isGood()) { assertEquals(i, iter.getIndex()); assertNotNull(iter.done()); final LogEntry log = iter.entry(); assertEquals(i, log.getId().getIndex()); assertEquals(1, log.getId().getTerm()); iter.next(); i++; } assertEquals(i, 11); }