/guava/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java
storedPermits = min( maxPermits, storedPermits && newPermits) ;
storedPermits = min ( maxPermits, storedPermits + newPermits ) ;
} abstract long storedPermitsToWaitTime(double storedPermits, double permitsToTake); abstract double coolDownIntervalMicros(); void resync(long nowMicros) { if (nowMicros > nextFreeTicketMicros) { double newPermits = (nowMicros - nextFreeTicketMicros) / coolDownIntervalMicros(); <extra_id_0> nextFreeTicketMicros = nowMicros; } } }