@Test
public void testMinuteBoundary()
{

    ticker.elapseTime(27, TimeUnit.HOURS);
    ticker.elapseTime(977_777, TimeUnit.NANOSECONDS);
    long startTime = getCurrentTimeNanos();
    BucketIdProvider idProvider = new MinuteBucketIdProvider(ticker);
    BucketId bucketId = idProvider.get();
    assertEquals(bucketId.getId(), 0, "initial state");
    assertGreaterThanOrEqual(bucketId.getTimestamp(), startTime);
    assertLessThanOrEqual(bucketId.getTimestamp(), getCurrentTimeNanos());
    ticker.elapseTime(59_999_999_999L, TimeUnit.NANOSECONDS);
    startTime = getCurrentTimeNanos();
    bucketId = idProvider.get();
    assertEquals(bucketId.getId(), 0, "before minute boundary");
    assertGreaterThanOrEqual(bucketId.getTimestamp(), startTime - 59_999_999_999L);
    assertLessThanOrEqual(bucketId.getTimestamp(), getCurrentTimeNanos() - 59_999_999_999L);
    ticker.elapseTime(1, TimeUnit.NANOSECONDS);
    startTime = getCurrentTimeNanos();
    bucketId = idProvider.get();
    assertEquals(bucketId.getId(), 1, "on minute boundary");
    assertGreaterThanOrEqual(bucketId.getTimestamp(), startTime);
    assertLessThanOrEqual(bucketId.getTimestamp(), getCurrentTimeNanos());
}