@Test public void testWaitForFinishReturnsBeforeTimeout() { long timeoutInMs = 1000; runner.getShutdownLatch().countDown(); boolean finished = runner.waitForFinish(Duration.ofMillis(timeoutInMs)); assertTrue("Application did not finish before the timeout.", finished); }