void logRun(long runIndex, boolean runSucceeded, Duration pollInterval, Instant runStartTime, Instant runEndTime) {
        if (runSucceeded && exceptionCounter > 0) {
            --exceptionCounter;
        }
        Duration actualRunDuration = Duration.between(runStartTime, runEndTime);
        if (actualRunDuration.compareTo(pollInterval) < 0) {
            LOGGER.debug("JobZooKeeper run took {}", actualRunDuration);
            runTookToLongCounter = 0;
        } else {
            LOGGER.debug("JobZooKeeper run took {} (while pollIntervalInSeconds is {})", actualRunDuration, pollInterval);
            if (runTookToLongCounter < 2) {
                runTookToLongCounter++;
            } else {
                dashboardNotificationManager.notify(new PollIntervalInSecondsTimeBoxIsTooSmallNotification(runIndex, (int) pollInterval.getSeconds(), runStartTime, (int) actualRunDuration.getSeconds()));
                runTookToLongCounter = 0;
            }
        }
    }
@Test
    void ifThreeConsecutiveRunsTookTooLongANotificationIsShown() {
        statistics.logRun(2, true, pollInterval, now().minusSeconds(45), now().minusSeconds(30));
        statistics.logRun(3, true, pollInterval, now().minusSeconds(30), now().minusSeconds(15));
        statistics.logRun(4, true, pollInterval, now().minusSeconds(15), now());

        verify(dashboardNotificationManager).notify(any(PollIntervalInSecondsTimeBoxIsTooSmallNotification.class));
    }