@Test public void m1InstantOfNextFrameShouldReturnNextMinute() { final M1 cut = new M1(); assertThat(cut.instantOfNextFrame(LocalDate.of(2004, Month.AUGUST, 12).atTime(13, 53, 59, 0).toInstant(UTC))) .isEqualTo(LocalDate.of(2004, Month.AUGUST, 12).atTime(13, 54, 0, 0).toInstant(UTC)); assertThat(cut.instantOfNextFrame(LocalDate.of(1993, Month.MARCH, 8).atTime(12, 54, 59, 0).toInstant(UTC))) .isEqualTo(LocalDate.of(1993, Month.MARCH, 8).atTime(12, 55, 00, 0).toInstant(UTC)); assertThat(cut.instantOfNextFrame(LocalDate.of(1875, Month.OCTOBER, 24).atTime(23, 32, 58, 0).toInstant(UTC))) .isEqualTo(LocalDate.of(1875, Month.OCTOBER, 24).atTime(23, 33, 00, 0).toInstant(UTC)); assertThat( cut.instantOfNextFrame(LocalDate.of(2654, Month.JANUARY, 10).atTime(05, 12, 59, 31842).toInstant(UTC))) .isEqualTo(LocalDate.of(2654, Month.JANUARY, 10).atTime(05, 13, 0, 0).toInstant(UTC)); }
@Override public Instant instantOfNextFrame(final Instant current) { return current.atOffset(UTC).withSecond(0).withNano(0).plusMinutes(1).toInstant(); }
M1 implements TimeFrame { @Override public Instant instantOfNextFrame(final Instant current) { return current.atOffset(UTC).withSecond(0).withNano(0).plusMinutes(1).toInstant(); } }
M1 implements TimeFrame { @Override public Instant instantOfNextFrame(final Instant current) { return current.atOffset(UTC).withSecond(0).withNano(0).plusMinutes(1).toInstant(); }  }
M1 implements TimeFrame { @Override public Instant instantOfNextFrame(final Instant current) { return current.atOffset(UTC).withSecond(0).withNano(0).plusMinutes(1).toInstant(); }  @Override Instant instantOfNextFrame(final Instant current); @Override boolean areInSameTimeFrame(final Instant instant1, final Instant instant2); }
M1 implements TimeFrame { @Override public Instant instantOfNextFrame(final Instant current) { return current.atOffset(UTC).withSecond(0).withNano(0).plusMinutes(1).toInstant(); }  @Override Instant instantOfNextFrame(final Instant current); @Override boolean areInSameTimeFrame(final Instant instant1, final Instant instant2);  }