class RateTracker {

  public synchronized long wantToRequestObjects(final long objectCount) {
    pruneRequests();
    if ((peerRateLimit - requestsWithinWindow) <= 0) {
      return 0L;
    }

    requestsWithinWindow += objectCount;
    requestCount.compute(
        timeProvider.getTimeInSeconds(),
        (key, val) -> val == null ? objectCount : val + objectCount);
    return objectCount;
  }

  public  RateTracker(
      final int peerRateLimit, final long timeoutSeconds, final TimeProvider timeProvider);

}