class DownloadDispatcher {

    public synchronized boolean isFileConflictAfterRun(@NonNull DownloadTask task) {
        Util.d(TAG, "is file conflict after run: " + task.getId());
        final File file = task.getFile();
        if (file == null) return false;

        // Other one is running, cancel the current task.
        for (DownloadCall syncCall : runningSyncCalls) {
            if (syncCall.isCanceled() || syncCall.task == task) continue;

            final File otherFile = syncCall.task.getFile();
            if (otherFile != null && file.equals(otherFile)) {
                return true;
            }
        }

        for (DownloadCall asyncCall : runningAsyncCalls) {
            if (asyncCall.isCanceled() || asyncCall.task == task) continue;

            final File otherFile = asyncCall.task.getFile();
            if (otherFile != null && file.equals(otherFile)) {
                return true;
            }
        }

        return false;
    }

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

}