code: private boolean completeSnapshot(long index) {
      // Compute the lowest completed index for all sessions that belong to this state machine.
      long lastCompleted = index;
      for (RaftSession session : raft.getSessions().getSessions()) {
        lastCompleted = Math.min(lastCompleted, session.getLastCompleted());
      }
      return lastCompleted >= index;
    }
docs: Determines whether to complete the snapshot at the given index.
  
  @param index the index of the snapshot to complete
  @return whether to complete the snapshot at the given index