docs: private long nanosToWaitForPermission(final long cyclePeriodInNanos, final int permissionsPerCycle,
                                            final int availablePermissions, final long currentNanos, final long currentCycle) {
          if (availablePermissions > 0) {
              return 0L;
          }
          long nextCycleTimeInNanos = (currentCycle + 1) * cyclePeriodInNanos;
          long nanosToNextCycle = nextCycleTimeInNanos - currentNanos;
          int fullCyclesToWait = (-availablePermissions) / permissionsPerCycle;
          return (fullCyclesToWait * cyclePeriodInNanos) + nanosToNextCycle;
      }