public Entry next() {
    if (currentEntry == null) {
      throw new IllegalStateException("Call hasNext first");
    }
    Entry save = peek();
    currentPositionOfEntry = currentPositionOfReader;
    currentEntry = null;
    state = null;
    return save;
  }
Returns the next WAL entry in this stream and advance the stream. Will throw
{@link IllegalStateException} if you do not call {@link #hasNext()} before calling this method.
Please see the javadoc of {@link #peek()} method to see why we need this.
@throws IllegalStateException Every time you want to call this method, please call
                              {@link #hasNext()} first, otherwise a
                              {@link IllegalStateException} will be thrown.
@see #hasNext()
@see #peek()
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java