FixedRateTask implements Task { ZonedDateTime scheduleNext() { scheduledTime = scheduledTime.plus(rate); return scheduledTime; } FixedRateTask(String name, Job job, Duration rate); @Override String name(); @Override Job job(); @Override String trigger();  }
@Test void scheduleNext() { FixedRateTask task = new FixedRateTask(null, null, Duration.ofSeconds(30)); ZonedDateTime start = ZonedDateTime.now(); task.scheduledTime = start; ZonedDateTime next = task.scheduleNext(); assertThat(Duration.between(start, next)).isEqualTo(Duration.ofSeconds(30)); }