code: private State reservePermissions(final RateLimiterConfig config, final long timeoutInNanos,
                                       final long cycle, final int permissions, final long nanosToWait) {
          boolean canAcquireInTime = timeoutInNanos >= nanosToWait;
          int permissionsWithReservation = permissions;
          if (canAcquireInTime) {
              permissionsWithReservation--;
          }
          return new State(config, cycle, permissionsWithReservation, nanosToWait);
      }
docs: Determines whether caller can acquire permission before timeout or not and then creates corresponding {@link State}.
  Reserves permissions only if caller can successfully wait for permission.
  
  @param config
  @param timeoutInNanos max time that caller can wait for permission in nanoseconds
  @param cycle          cycle for new {@link State}
  @param permissions    permissions for new {@link State}
  @param nanosToWait    nanoseconds to wait for the next permission
  @return new {@link State} with possibly reserved permissions and time to wait