docs: public void registerIndexQuery(long index, Runnable query) {
      // Add a query to be run once the session's index reaches the given index.
      List<Runnable> queries = this.indexQueries.computeIfAbsent(index, v -> new LinkedList<>());
      queries.add(query);
    }