code: public void registerSequenceQuery(long sequence, Runnable query) {
      // Add a query to be run once the session's sequence number reaches the given sequence number.
      List<Runnable> queries = this.sequenceQueries.computeIfAbsent(sequence, v -> new LinkedList<Runnable>());
      queries.add(query);
    }
docs: Registers a causal session query.
  
  @param sequence The session sequence number at which to execute the query.
  @param query    The query to execute.