@Test public void timeoutWillOccur() throws InterruptedException { CountDownLatch latch = new CountDownLatch(1); timeoutService.scheduleTimeout(new TestTimeout(latch), 10L); latch.await(); assertTrue(didTimeout); }
@Override public void scheduleTimeout(Timeout timeout, long timeoutMillis) { scheduleTimeout(timeout, timeoutMillis, System.nanoTime()); }
DelayQueueTimeoutService implements TimeoutService { @Override public void scheduleTimeout(Timeout timeout, long timeoutMillis) { scheduleTimeout(timeout, timeoutMillis, System.nanoTime()); } }
DelayQueueTimeoutService implements TimeoutService { @Override public void scheduleTimeout(Timeout timeout, long timeoutMillis) { scheduleTimeout(timeout, timeoutMillis, System.nanoTime()); } DelayQueueTimeoutService(String name);  DelayQueueTimeoutService(String name, Clock clock, Thread.UncaughtExceptionHandler exceptionHandler); }
DelayQueueTimeoutService implements TimeoutService { @Override public void scheduleTimeout(Timeout timeout, long timeoutMillis) { scheduleTimeout(timeout, timeoutMillis, System.nanoTime()); } DelayQueueTimeoutService(String name);  DelayQueueTimeoutService(String name, Clock clock, Thread.UncaughtExceptionHandler exceptionHandler); @Override void scheduleTimeout(Timeout timeout, long timeoutMillis); @Override void scheduleTimeout(Timeout timeout, long timeoutMillis, long nanoTime); void stop(); static long adjustTimeout(long millisTimeout); }
DelayQueueTimeoutService implements TimeoutService { @Override public void scheduleTimeout(Timeout timeout, long timeoutMillis) { scheduleTimeout(timeout, timeoutMillis, System.nanoTime()); } DelayQueueTimeoutService(String name);  DelayQueueTimeoutService(String name, Clock clock, Thread.UncaughtExceptionHandler exceptionHandler); @Override void scheduleTimeout(Timeout timeout, long timeoutMillis); @Override void scheduleTimeout(Timeout timeout, long timeoutMillis, long nanoTime); void stop(); static long adjustTimeout(long millisTimeout); static final long MAX_TIMEOUT_MILLIS; static final DelayQueueTimeoutService DEFAULT_TIMEOUT_SERVICE; }