CacheDispatcher extends Thread { public void quit() { mQuit = true; interrupt(); } CacheDispatcher(
            BlockingQueue<Request<?>> cacheQueue,
            BlockingQueue<Request<?>> networkQueue,
            Cache cache,
            ResponseDelivery delivery); void quit(); @Override void run();  }
@Test public void runStopsOnQuit() throws Exception { when(mCacheQueue.take()).then(new WaitForever()); mDispatcher.start(); mDispatcher.quit(); mDispatcher.join(1000); }