public synchronized Optional<AuditLogEntry> next() throws SQLException, AuditLogEntryException {
  if (auditLogEntries.size() > 0) {
    return Optional.of(auditLogEntries.remove());
  }
  LOG.debug("Executing queries to try to get more audit log entries from the DB");
  fetchMoreEntries();
  if (auditLogEntries.size() > 0) {
    return Optional.of(auditLogEntries.remove());
  }
 else {
    return Optional.empty();
  }
}

public synchronized Optional < AuditLogEntry > next ( ) throws SQLException , AuditLogEntryException { if ( auditLogEntries . size ( ) > 0 ) { return Optional . of ( auditLogEntries . remove ( ) ) ; } LOG . debug ( "Executing queries to try to get more audit log entries from the DB" ) ; fetchMoreEntries ( ) ; if ( auditLogEntries . size ( ) > 0 ) { return Optional . of ( auditLogEntries . remove ( ) ) ; } else { return Optional . empty ( ) ; } }
return the next audit log entry from the db .
