private @Nullable <K, V> IntSet collectFileIdsContainingAllKeys(@NotNull ID<K, V> indexId,
                                                                  @NotNull Collection<? extends K> dataKeys,
                                                                  @NotNull GlobalSearchScope scope,
                                                                  @Nullable Condition<? super V> valueChecker,
                                                                  @Nullable IdFilter projectFilesFilter,
                                                                  @Nullable IntSet restrictedIds) {
    try (var trace = lookupEntriesStarted(indexId)) {
      trace.keysWithAND(dataKeys.size())
        .withProject(scope.getProject());

      IntPredicate accessibleFileFilter = getAccessibleFileIdFilter(scope.getProject());
      IntPredicate idChecker = id -> (projectFilesFilter == null || projectFilesFilter.containsFileId(id)) &&
                                     accessibleFileFilter.test(id) &&
                                     (restrictedIds == null || restrictedIds.contains(id));
      ThrowableConvertor<UpdatableIndex<K, V, FileContent, ?>, IntSet, StorageException> convertor = index -> {
        trace.totalKeysIndexed(keysCountApproximatelyIfPossible(index));
        IndexDebugProperties.DEBUG_INDEX_ID.set(indexId);
        try {
          return InvertedIndexUtil.collectInputIdsContainingAllKeys(index, dataKeys, valueChecker, idChecker);
        }
        finally {
          IndexDebugProperties.DEBUG_INDEX_ID.remove();
        }
      };

      final IntSet ids = processExceptions(indexId, null, scope, convertor);

      trace.lookupResultSize(ids != null ? ids.size() : 0);
      return ids;
    }
  }
private @Nullable <K, V> IntSet collectFileIdsContainingAllKeys(@NotNull ID<K, V> indexId,
                                                                  @NotNull Collection<? extends K> dataKeys,
                                                                  @NotNull GlobalSearchScope scope,
                                                                  @Nullable Condition<? super V> valueChecker,
                                                                  @Nullable IdFilter projectFilesFilter,
                                                                  @Nullable IntSet restrictedIds)