@Test
public void testRegister()
{

  CustomTimeBucketRegistry timeBucketRegistry = new CustomTimeBucketRegistry();
  CustomTimeBucket c1m = new CustomTimeBucket(TimeBucket.MINUTE);
  CustomTimeBucket c1h = new CustomTimeBucket(TimeBucket.HOUR);
  CustomTimeBucket c1d = new CustomTimeBucket(TimeBucket.DAY);
  timeBucketRegistry.register(c1m, TimeBucket.MINUTE.ordinal());
  timeBucketRegistry.register(c1h, TimeBucket.HOUR.ordinal());
  timeBucketRegistry.register(c1d, TimeBucket.DAY.ordinal());
  int max = Integer.MIN_VALUE;
  max = Math.max(max, TimeBucket.MINUTE.ordinal());
  max = Math.max(max, TimeBucket.HOUR.ordinal());
  max = Math.max(max, TimeBucket.DAY.ordinal());
  CustomTimeBucket c5m = new CustomTimeBucket(TimeBucket.MINUTE, 5L);
  timeBucketRegistry.register(c5m);
  int timeBucketId = timeBucketRegistry.getTimeBucketId(c5m);
  Assert.assertEquals(max + 1, timeBucketId);
}