@Test
public void testTimeTrySetTimer()
        throws Exception
{

    SparseTimeStat oldStat = new SparseTimeStat(ticker);
    SparseTimeStat stat = new SparseTimeStat(ticker);
    stat.setBucketIdProvider(bucketIdProvider);
    try (BlockTimer timer = oldStat.time()) {
        ticker.elapseTime(10, TimeUnit.MILLISECONDS);
        timer.timeTo(stat);
    }
    ++bucketIdProvider.id;
    assertPreviousDistribution(stat, 1, 0.010, 0.010, 0.010);
    assertPreviousDistributionEmpty(oldStat);
}