public void reportMeasurement(final long durationNs)
    {
        if (!maxCycleTime.isClosed())
        {
            maxCycleTime.proposeMaxOrdered(durationNs);

            if (durationNs > cycleTimeThresholdNs)
            {
                cycleTimeThresholdExceededCount.incrementOrdered();
            }
        }
    }
@Test
    void reportMeasurementOnlyUpdatesThresholdCounterWhenExceeded()
    {
        final AtomicCounter maxCycleTime = mock(AtomicCounter.class);
        when(maxCycleTime.isClosed()).thenReturn(false);
        final AtomicCounter cycleTimeThresholdExceededCount = mock(AtomicCounter.class);
        final int cycleTimeThresholdNs = 1000;
        final DutyCycleStallTracker dutyCycleStallTracker =
            new DutyCycleStallTracker(maxCycleTime, cycleTimeThresholdExceededCount, cycleTimeThresholdNs);

        dutyCycleStallTracker.reportMeasurement(555);
        dutyCycleStallTracker.reportMeasurement(1000);
        dutyCycleStallTracker.reportMeasurement(1001);

        verify(maxCycleTime, times(3)).isClosed();
        verify(maxCycleTime).proposeMaxOrdered(555L);
        verify(maxCycleTime).proposeMaxOrdered(1000L);
        verify(maxCycleTime).proposeMaxOrdered(1001L);
        verify(cycleTimeThresholdExceededCount).incrementOrdered();
        verifyNoMoreInteractions(maxCycleTime, cycleTimeThresholdExceededCount);
    }