private boolean processTopHits(String pattern, Predicate<? super MatchedValue> consumer) {
    Project project = myModel.getProject();
    CollectConsumer<Object> collector = new CollectConsumer<>();
    String commandAccelerator = SearchTopHitProvider.getTopHitAccelerator();
    for (SearchTopHitProvider provider : SearchTopHitProvider.EP_NAME.getExtensionList()) {
      //noinspection deprecation
      if (provider instanceof OptionsTopHitProvider.CoveredByToggleActions) {
        continue;
      }

      if (provider instanceof OptionsSearchTopHitProvider && !pattern.startsWith(commandAccelerator)) {
        String prefix = commandAccelerator + ((OptionsSearchTopHitProvider)provider).getId() + " ";
        provider.consumeTopHits(prefix + pattern, collector, project);
      }
      else if (project != null && provider instanceof OptionsTopHitProvider.ProjectLevelProvidersAdapter) {
        ((OptionsTopHitProvider.ProjectLevelProvidersAdapter)provider).blockingConsumeAllTopHits(pattern, it -> {
          collector.accept(it);
          return Unit.INSTANCE;
        }, project);
      }
      provider.consumeTopHits(pattern, collector, project);
    }

    Collection<Object> result = collector.getResult();
    Stream<?> wrappers = result.stream()
      .map(object -> object instanceof AnAction ? wrapAnAction((AnAction)object) : object);
    return processItems(pattern, MatchedValueType.TOP_HIT, wrappers, consumer);
  }
private boolean processTopHits(String pattern, Predicate<? super MatchedValue> consumer)