Watchdog implements Runnable { public void stop() { ScheduledFuture<?> tmp = scheduledFuture; scheduledFuture = null; if (tmp != null) { tmp.cancel(true); } } Watchdog(Clock clock, long waitTimeoutMs);  Watchdog(Clock clock, long waitTimeoutMs, long idleTimeoutMs); ClientCall<ReqT, RespT> watch(ClientCall<ReqT, RespT> innerCall); void run(); void start(ScheduledExecutorService executor); void stop();  }
@Test public void testStopTwice() throws Exception { watchdog.stop(); watchdog.stop(); }