@Test
public void shouldGetLastInstant() {

  final Instant lastTimeHours = parse("2016-01-19T09:00:00.00Z");
  final Instant lastTimeDays = parse("2016-01-19T00:00:00.00Z");
  final Instant lastTimeWeeks = parse("2016-01-18T00:00:00.00Z");
  final Instant lastTimeMonths = parse("2016-01-01T00:00:00.00Z");
  final Instant hour = lastInstant(TIME, Schedule.HOURS);
  assertThat(hour, is(lastTimeHours));
  final Instant day = lastInstant(TIME, Schedule.DAYS);
  assertThat(day, is(lastTimeDays));
  final Instant weeks = lastInstant(TIME, Schedule.WEEKS);
  assertThat(weeks, is(lastTimeWeeks));
  final Instant months = lastInstant(TIME, Schedule.MONTHS);
  assertThat(months, is(lastTimeMonths));
}