docs: private long reserveNextTicket(double requiredPermits, long nowMicros) {
      resync(nowMicros);
      long microsToNextFreeTicket = Math.max(0, nextFreeTicketMicros - nowMicros);
      double storedPermitsToSpend = Math.min(requiredPermits, this.storedPermits);
      double freshPermits = requiredPermits - storedPermitsToSpend;
  
      long waitMicros = storedPermitsToWaitTime(this.storedPermits, storedPermitsToSpend)
          + (long) (freshPermits * stableIntervalMicros);
  
      this.nextFreeTicketMicros = nextFreeTicketMicros + waitMicros;
      this.storedPermits -= storedPermitsToSpend;
      return microsToNextFreeTicket;
    }