public function testConsume()
{
$rate = new Rate(1, Rate::SECOND);
$bucket = new TokenBucket(10, $rate, new SingleProcessStorage());
$bucket->bootstrap(10);
$this->assertTrue($bucket->consume(1));
$this->assertTrue($bucket->consume(2));
$this->assertTrue($bucket->consume(3));
$this->assertTrue($bucket->consume(4));
$this->assertFalse($bucket->consume(1));
sleep(3);
$this->assertFalse($bucket->consume(4, $seconds));
$this->assertEquals(1, $seconds);
}