@Test
public void testFeb28ToMarch1NonLeapYear() {

  final long time = 47920164930285667L;
  final Calendar startCal = Calendar.getInstance();
  startCal.setTimeInMillis(time);
  startCal.set(Calendar.MONTH, 1);
  startCal.set(Calendar.YEAR, 2015);
  startCal.set(Calendar.DAY_OF_MONTH, 28);
  final Calendar endCal = Calendar.getInstance();
  endCal.setTimeInMillis(time);
  endCal.set(Calendar.MONTH, 2);
  endCal.set(Calendar.YEAR, 2015);
  endCal.set(Calendar.DAY_OF_MONTH, 1);
  // test the day boundaries first - going from feb28 to march 1 should
  // give 2 bins
  TemporalBinningStrategy binStrategy = new TemporalBinningStrategy(Unit.DAY);
  BinRange[] ranges =
      binStrategy.getNormalizedRanges(
          new NumericRange(startCal.getTimeInMillis(), endCal.getTimeInMillis()));
  Assert.assertEquals(2, ranges.length);
  // now test the month boundaries - adding a day to feb28 for the end
  // time should give 2 bins
  binStrategy = new TemporalBinningStrategy(Unit.MONTH);
  ranges =
      binStrategy.getNormalizedRanges(
          new NumericRange(
              startCal.getTimeInMillis(),
              startCal.getTimeInMillis() + (TemporalBinningStrategy.MILLIS_PER_DAY)));
  Assert.assertEquals(2, ranges.length);
}