@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); }
public static long availableTimeout(long expectedTimeoutMillis) { return availableTimeout(expectedTimeoutMillis, 0); }
WatchTimeout { public static long availableTimeout(long expectedTimeoutMillis) { return availableTimeout(expectedTimeoutMillis, 0); } }
WatchTimeout { public static long availableTimeout(long expectedTimeoutMillis) { return availableTimeout(expectedTimeoutMillis, 0); } private  WatchTimeout(); }
WatchTimeout { public static long availableTimeout(long expectedTimeoutMillis) { return availableTimeout(expectedTimeoutMillis, 0); } private  WatchTimeout(); static long availableTimeout(long expectedTimeoutMillis); static long availableTimeout(long expectedTimeoutMillis, long currentTimeoutMillis); }
WatchTimeout { public static long availableTimeout(long expectedTimeoutMillis) { return availableTimeout(expectedTimeoutMillis, 0); } private  WatchTimeout(); static long availableTimeout(long expectedTimeoutMillis); static long availableTimeout(long expectedTimeoutMillis, long currentTimeoutMillis); static final long MAX_MILLIS; }