boolean processChangedFiles(@NotNull Project project, @NotNull Processor<? super VirtualFile> processor) {
    // can be performance critical, better to use cycle instead of streams
    // avoid missing files when events are processed concurrently
    Iterator<FileIndexingRequest> iterator = Iterators.concat(
      ContainerUtil.mapIterator(getChangedFilesCollector().getEventMerger().getChangedFiles(), FileIndexingRequest::updateRequest),
      getFilesToUpdateCollector().getFilesToUpdateAsIterator()
    );

    HashSet<FileIndexingRequest> checkedFiles = new HashSet<>();
    Predicate<FileIndexingRequest> filterPredicate = filesToBeIndexedForProjectCondition(project);

    while (iterator.hasNext()) {
      FileIndexingRequest indexingRequest = iterator.next();
      if (filterPredicate.test(indexingRequest) && !checkedFiles.contains(indexingRequest)) {
        checkedFiles.add(indexingRequest);
        if (!processor.process(indexingRequest.getFile())) return false;
      }
    }

    return true;
  }
boolean processChangedFiles(@NotNull Project project, @NotNull Processor<? super VirtualFile> processor)