docs: private void releaseSession(Session session) {
      // Remove all instances of the session from the lock queue.
      queue.removeIf(lock -> lock.session.equals(session.sessionId()));
  
      // If the removed session is the current holder of the lock, nullify the lock and attempt to grant it
      // to the next waiter in the queue.
      if (lock != null && lock.session.equals(session.sessionId())) {
        lock = queue.poll();
        while (lock != null) {
          // If the waiter has a lock timer, cancel the timer.
          Scheduled timer = timers.remove(lock.index);
          if (timer != null) {
            timer.cancel();
          }
  
          // Notify the client that it has acquired the lock.
          Session lockSession = getSession(lock.session);
          if (lockSession != null && lockSession.getState().active()) {
            getSession(lock.session).accept(service -> service.locked(lock.id, lock.index));
            break;
          }
          lock = queue.poll();
        }
      }
    }