### Question:
DownloadCall extends NamedRunnable implements Comparable<DownloadCall> { void startBlocks(List<DownloadChain> tasks) throws InterruptedException { ArrayList<Future> futures = new ArrayList<>(tasks.size()); try { for (DownloadChain chain : tasks) { futures.add(submitChain(chain)); } blockChainList.addAll(tasks); for (Future future : futures) { if (!future.isDone()) { try { future.get(); } catch (CancellationException | ExecutionException ignore) { } } } } catch (Throwable t) { for (Future future : futures) { future.cancel(true); } throw t; } finally { blockChainList.removeAll(tasks); } } private  DownloadCall(DownloadTask task, boolean asyncExecuted, @NonNull DownloadStore store);   DownloadCall(DownloadTask task, boolean asyncExecuted,
                 @NonNull ArrayList<DownloadChain> runningBlockList,
                 @NonNull DownloadStore store); static DownloadCall create(DownloadTask task, boolean asyncExecuted,
                                      @NonNull DownloadStore store); boolean cancel(); boolean isCanceled(); boolean isFinishing(); @Override void execute(); boolean equalsTask(@NonNull DownloadTask task); @Nullable File getFile(); @SuppressFBWarnings(value = "Eq", justification = "This special case is just for task priority") @Override int compareTo(@NonNull DownloadCall o); final DownloadTask task; final boolean asyncExecuted; }### Answer:
@Test public void startBlocks() throws InterruptedException { ArrayList<DownloadChain> runningBlockList = spy(new ArrayList<DownloadChain>()); call = spy(new DownloadCall(task, false, runningBlockList, store)); final Future mockFuture = mock(Future.class); doReturn(mockFuture).when(call).submitChain(any(DownloadChain.class)); List<DownloadChain> chains = new ArrayList<>(); chains.add(mock(DownloadChain.class)); chains.add(mock(DownloadChain.class)); chains.add(mock(DownloadChain.class)); call.startBlocks(chains); verify(call, times(3)).submitChain(any(DownloadChain.class)); verify(runningBlockList).addAll(eq(chains)); verify(runningBlockList).removeAll(eq(chains)); }