docs: public void commit(long index) {
      if (currentEventList != null && currentEventList.eventIndex == index) {
        events.add(currentEventList);
        sendEvents(currentEventList);
        currentEventList = null;
      }
      setLastApplied(index);
    }