### Question:
NetworkTaskManager { void cancelTasks() { for (AsyncTask task : taskList) { task.cancel(true); } taskList.clear(); } NetworkTaskManager(AddReviewActivity<T> addReviewActivity, NetworkTaskCreator<AsyncTask, T> networkTaskCreator); void createAndExecute(Call... call); List<AsyncTask> getTaskList(); void setTaskList(List<AsyncTask> taskList);  }### Answer:
@Test public void cancelTasks() throws Exception { final MovieNetworkTask anotherNetworkTask = mock(MovieNetworkTask.class); NetworkTaskManager networkTaskManager = new NetworkTaskManager(addReviewActivity, networkTaskCreator); networkTaskManager.setTaskList( new ArrayList<AsyncTask>() {{ add(networkTask); add(anotherNetworkTask); }} ); networkTaskManager.cancelTasks(); verify(networkTask).cancel(true); verify(anotherNetworkTask).cancel(true); assertEquals(emptyList(), networkTaskManager.getTaskList()); }