static Duration timeout(int clients) {
        Duration timeout = Duration.ofSeconds(Long.max(MIN_TIMEOUT.toSeconds(), clients));
        return timeout.compareTo(MAX_TIMEOUT) > 0 ? MAX_TIMEOUT : timeout;
    }
@Test
    public void test_timeout_calculation() {
        assertEquals(MIN_TIMEOUT, timeout(1));
        assertEquals(MIN_TIMEOUT, timeout(20));

        // These values must be updated if the calculation in the timeout method itself is changed.
        assertEquals(Duration.ofSeconds(100), timeout(100));
        assertEquals(Duration.ofSeconds(200), timeout(200));
        assertEquals(MAX_TIMEOUT, timeout(240));
    }