@Test
public void testTryTakeRange() throws Exception {

    Pair<Long, ImmutableTokenBucket> next = doTryTake(tokenBucket, 1, BUCKET_SIZE + 1);
    assertThat(next.getLeft()).isEqualTo(BUCKET_SIZE);
    assertThat(next.getRight().tryTake()).isEmpty();
    testClock.advanceTime(10 * REFILL_INTERVAL_MS, TimeUnit.MILLISECONDS);
    next = doTryTake(next.getRight(), 1, BUCKET_SIZE + 1);
    assertThat(next.getLeft()).isEqualTo(BUCKET_SIZE);
    assertThat(next.getRight().tryTake()).isEmpty();
}