@Test public void performBatchCompleteFlushesHunters() { BitmapHunter hunter1 = mockHunter(URI_KEY_2, bitmap1, false); BitmapHunter hunter2 = mockHunter(URI_KEY_2, bitmap2, false); dispatcher.batch.add(hunter1); dispatcher.batch.add(hunter2); dispatcher.performBatchComplete(); assertThat(dispatcher.batch).isEmpty(); }
void performBatchComplete() { List<BitmapHunter> copy = new ArrayList<>(batch); batch.clear(); mainThreadHandler.sendMessage(mainThreadHandler.obtainMessage(HUNTER_BATCH_COMPLETE, copy)); logBatch(copy); }
Dispatcher { void performBatchComplete() { List<BitmapHunter> copy = new ArrayList<>(batch); batch.clear(); mainThreadHandler.sendMessage(mainThreadHandler.obtainMessage(HUNTER_BATCH_COMPLETE, copy)); logBatch(copy); } }
Dispatcher { void performBatchComplete() { List<BitmapHunter> copy = new ArrayList<>(batch); batch.clear(); mainThreadHandler.sendMessage(mainThreadHandler.obtainMessage(HUNTER_BATCH_COMPLETE, copy)); logBatch(copy); } Dispatcher(Context context, ExecutorService service, Handler mainThreadHandler,
      Downloader downloader, Cache cache, Stats stats); }
Dispatcher { void performBatchComplete() { List<BitmapHunter> copy = new ArrayList<>(batch); batch.clear(); mainThreadHandler.sendMessage(mainThreadHandler.obtainMessage(HUNTER_BATCH_COMPLETE, copy)); logBatch(copy); } Dispatcher(Context context, ExecutorService service, Handler mainThreadHandler,
      Downloader downloader, Cache cache, Stats stats);  }
Dispatcher { void performBatchComplete() { List<BitmapHunter> copy = new ArrayList<>(batch); batch.clear(); mainThreadHandler.sendMessage(mainThreadHandler.obtainMessage(HUNTER_BATCH_COMPLETE, copy)); logBatch(copy); } Dispatcher(Context context, ExecutorService service, Handler mainThreadHandler,
      Downloader downloader, Cache cache, Stats stats);   }