@Test
public void testWithBucketIdProvider()
        throws Exception
{

    SparseCounterStat counter = new SparseCounterStat();
    counter.setBucketIdProvider(bucketIdProvider);
    counter.add(1);
    assertPreviousCountNull(counter);
    ++bucketIdProvider.id;
    counter.add(2);
    counter.add(2.2);
    assertPreviousCount(counter, 1);
    ++bucketIdProvider.id;
    assertPreviousCount(counter, 4.2);
}