@Test
public void testEmptyBucketsFillIn() {

    MockedTime time = new MockedTime();
    try {
        HystrixRollingNumber counter = new HystrixRollingNumber(time, 200, 10);
        // add 1
        counter.increment(HystrixRollingNumberEvent.SUCCESS);
        // we should have 1 bucket
        assertEquals(1, counter.buckets.size());
        // wait past 3 bucket time periods (the 1st bucket then 2 empty ones)
        time.increment(counter.bucketSizeInMillseconds * 3);
        // add another
        counter.increment(HystrixRollingNumberEvent.SUCCESS);
        // we should have 4 (1 + 2 empty + 1 new one) buckets
        assertEquals(4, counter.buckets.size());
    } catch (Exception e) {
        e.printStackTrace();
        fail("Exception: " + e.getMessage());
    }
}