@Test
void acquire() {

    RateControl.Rate rate = new RateControl.Rate(1);
    rate.lastUpdateTime = 100;
    boolean result = rate.acquire(101, 2, 1);
    assertThat(result).isTrue();
    assertThat(rate.currentPermits).isEqualTo(1);
    result = rate.acquire(101, 2, 1);
    assertThat(result).isTrue();
    assertThat(rate.currentPermits).isEqualTo(0);
    result = rate.acquire(101, 2, 1);
    assertThat(result).isFalse();
    result = rate.acquire(102, 2, 1);
    assertThat(result).isTrue();
    assertThat(rate.currentPermits).isEqualTo(0);
}