private <T> boolean processCandidates(@NotNull Map<T, Processor<CandidateFileInfo>> localProcessors,
                                        @NotNull Map<VirtualFile, Collection<T>> candidateFiles,
                                        @NotNull ProgressIndicator progress,
                                        int totalSize,
                                        int alreadyProcessedFiles) {
    List<VirtualFile> files = new ArrayList<>(candidateFiles.keySet());

    return processPsiFileRoots(files, totalSize, alreadyProcessedFiles, progress, candidateInfo -> {
      VirtualFile vfile = candidateInfo.candidateFile();
      if (vfile instanceof BackedVirtualFile) {
        vfile = ((BackedVirtualFile)vfile).getOriginFile();
      }
      for (T singleRequest : candidateFiles.get(vfile)) {
        ProgressManager.checkCanceled();
        Processor<CandidateFileInfo> localProcessor = localProcessors.get(singleRequest);
        if (!localProcessor.process(candidateInfo)) {
          return false;
        }
      }
      return true;
    });
  }
private <T> boolean processCandidates(@NotNull Map<T, Processor<CandidateFileInfo>> localProcessors,
                                        @NotNull Map<VirtualFile, Collection<T>> candidateFiles,
                                        @NotNull ProgressIndicator progress,
                                        int totalSize,
                                        int alreadyProcessedFiles)