class DownloadDispatcher {

    @SuppressWarnings("PMD.ForLoopsMustUseBraces")
    public void cancelAll() {
        skipProceedCallCount.incrementAndGet();
        // assemble tasks
        List<DownloadTask> taskList = new ArrayList<>();
        for (DownloadCall call : readyAsyncCalls) taskList.add(call.task);
        for (DownloadCall call : runningAsyncCalls) taskList.add(call.task);
        for (DownloadCall call : runningSyncCalls) taskList.add(call.task);

        if (!taskList.isEmpty()) {
            DownloadTask[] tasks = new DownloadTask[taskList.size()];
            cancelLocked(taskList.toArray(tasks));
        }

        skipProceedCallCount.decrementAndGet();
    }

    public  DownloadDispatcher();
      DownloadDispatcher(List<DownloadCall> readyAsyncCalls,
                       List<DownloadCall> runningAsyncCalls,
                       List<DownloadCall> runningSyncCalls,
                       List<DownloadCall> finishingCalls);

}