private void assertPreviousCount(SparseCounterStat counter, double expected)
throws Exception
{
Method method = Bucketed.class.getDeclaredMethod("getPreviousBucket");
method.setAccessible(true);
Counter previousBucket = (Counter) method.invoke(counter);
assertEquals(previousBucket.getCount(), expected);
}