@Override
  public void start() {
    this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(
      new ThreadFactoryBuilder()
        .setDaemon(true)
        .setNameFormat(getClass().getCanonicalName() + "-thread-%d")
        .build());
    for (MonitoringTask task : monitoringTasks) {
      scheduledExecutorService.scheduleWithFixedDelay(task, task.getDelay(), task.getPeriod(), MILLISECONDS);
    }
  }
@Test
  public void start_givenTwoTasks_callsGetsDelayAndPeriodFromTasks() {
    underTest.start();

    verify(task1, times(1)).getDelay();
    verify(task1, times(1)).getPeriod();
    verify(task2, times(1)).getDelay();
    verify(task2, times(1)).getPeriod();
  }