@Test
public void shouldGetCorrectInstants() {

  final Instant firstTimeHours = parse("2016-01-19T00:00:00.00Z");
  final Instant lastTimeHours = parse("2016-01-19T03:00:00.00Z");
  final Instant firstTimeDays = parse("2016-01-10T00:00:00.00Z");
  final Instant lastTimeDays = parse("2016-01-13T00:00:00.00Z");
  final Instant firstTimeWeeks = parse("2016-01-11T00:00:00.00Z");
  final Instant lastTimeWeeks = parse("2016-01-18T00:00:00.00Z");
  final Instant firstTimeMonths = parse("2010-01-01T00:00:00.00Z");
  final Instant lastTimeMonths = parse("2013-01-01T00:00:00.00Z");
  assertThat(instantsInRange(firstTimeHours, lastTimeHours, Schedule.HOURS),
      contains(parse("2016-01-19T00:00:00.00Z"),
          parse("2016-01-19T01:00:00.00Z"),
          parse("2016-01-19T02:00:00.00Z")));
  assertThat(instantsInRange(firstTimeDays, lastTimeDays, Schedule.DAYS),
      contains(parse("2016-01-10T00:00:00.00Z"),
          parse("2016-01-11T00:00:00.00Z"),
          parse("2016-01-12T00:00:00.00Z")));
  assertThat(instantsInRange(firstTimeWeeks, lastTimeWeeks, Schedule.WEEKS),
      contains(parse("2016-01-11T00:00:00.00Z")));
  assertThat(instantsInRange(firstTimeMonths, lastTimeMonths, Schedule.YEARS),
      contains(parse("2010-01-01T00:00:00.00Z"),
          parse("2011-01-01T00:00:00.00Z"),
          parse("2012-01-01T00:00:00.00Z")));
}