    @Test
    void testMakeReasonable() {

        assertThat(availableTimeout(1_000, 0)).isEqualTo(1_000);
        assertThat(availableTimeout(1_000, 1_000)).isEqualTo(1_000);
        assertThat(availableTimeout(MAX_MILLIS, 1_000)).isEqualTo(MAX_MILLIS - 1_000);
        assertThat(availableTimeout(MAX_MILLIS + 1_000, 0)).isEqualTo(MAX_MILLIS);
        assertThat(availableTimeout(MAX_MILLIS - 1_000, 500)).isEqualTo(MAX_MILLIS - 1000);

        assertThatThrownBy(() -> availableTimeout(0, 1_000))
                .isInstanceOf(IllegalArgumentException.class);
        assertThatThrownBy(() -> availableTimeout(-1, 1_000))
                .isInstanceOf(IllegalArgumentException.class);
        assertThatThrownBy(() -> availableTimeout(1_000, -1))
                .isInstanceOf(IllegalArgumentException.class);
    }