private <K, V> boolean processValueIterator(@NotNull ID<K, V> indexId,
                                              @NotNull K dataKey,
                                              @Nullable VirtualFile restrictToFile,
                                              @NotNull GlobalSearchScope scope,
                                              @NotNull Processor<? super InvertedIndexValueIterator<V>> valueProcessor) {
    try (var trace = lookupEntriesStarted(indexId)) {
      trace.keysWithAND(1)
        .withProject(scope.getProject());
      //TODO RC: .scopeFiles( restrictToFile == null ? -1 : 1 )
      final ThrowableConvertor<UpdatableIndex<K, V, FileContent, ?>, Boolean, StorageException> convertor = index -> {
        trace.totalKeysIndexed(keysCountApproximatelyIfPossible(index));
        var valuesIterator = (InvertedIndexValueIterator<V>)index.getData(dataKey).getValueIterator();
        return valueProcessor.process(valuesIterator);
      };
      final Boolean result = processExceptions(indexId, restrictToFile, scope, convertor);
      return result == null || result.booleanValue();
    }
  }
private <K, V> boolean processValueIterator(@NotNull ID<K, V> indexId,
                                              @NotNull K dataKey,
                                              @Nullable VirtualFile restrictToFile,
                                              @NotNull GlobalSearchScope scope,
                                              @NotNull Processor<? super InvertedIndexValueIterator<V>> valueProcessor)