@Test
public void testWithBucketIdProvider()
        throws Exception
{

    MaxGauge maxGauge = new MaxGauge();
    maxGauge.setBucketIdProvider(bucketIdProvider);
    maxGauge.update(1);
    assertPreviousMax(maxGauge, 0);
    ++bucketIdProvider.id;
    maxGauge.update(3);
    maxGauge.update(2);
    assertPreviousMax(maxGauge, 1);
    ++bucketIdProvider.id;
    assertPreviousMax(maxGauge, 3);
    ++bucketIdProvider.id;
    assertPreviousMax(maxGauge, 2);
}