@GwtIncompatible // threads public void testOverflowTimeout() throws Exception { // First, sanity check that naive multiplication would really overflow to a negative number: long nanosPerSecond = NANOSECONDS.convert(1, SECONDS); assertThat(nanosPerSecond * Long.MAX_VALUE).isLessThan(0L); // Check that we wait long enough anyway (presumably as long as MAX_VALUE nanos): TimedWaiterThread waiter = new TimedWaiterThread(future, Long.MAX_VALUE, SECONDS); waiter.start(); waiter.awaitWaiting(); future.set(1); waiter.join(); }