docs: private long[] applyKeepAlive(Indexed<KeepAliveEntry> entry) {
  
      // Store the session/command/event sequence and event index instead of acquiring a reference to the entry.
      long[] sessionIds = entry.entry().sessionIds();
      long[] commandSequences = entry.entry().commandSequenceNumbers();
      long[] eventIndexes = entry.entry().eventIndexes();
  
      // Iterate through session identifiers and keep sessions alive.
      List<Long> successfulSessionIds = new ArrayList<>(sessionIds.length);
      Set<RaftServiceContext> services = new HashSet<>();
      for (int i = 0; i < sessionIds.length; i++) {
        long sessionId = sessionIds[i];
        long commandSequence = commandSequences[i];
        long eventIndex = eventIndexes[i];
  
        RaftSession session = raft.getSessions().getSession(sessionId);
        if (session != null) {
          if (session.getService().keepAlive(entry.index(), entry.entry().timestamp(), session, commandSequence, eventIndex)) {
            successfulSessionIds.add(sessionId);
            services.add(session.getService());
          }
        }
      }
  
      // Iterate through services and complete keep-alives, causing sessions to be expired if necessary.
      for (RaftServiceContext service : services) {
        service.completeKeepAlive(entry.index(), entry.entry().timestamp());
      }
  
      expireOrphanSessions(entry.entry().timestamp());
  
      return Longs.toArray(successfulSessionIds);
    }