private static void processNamesByPattern(@NotNull final ChooseByNameViewModel base,
                                            final String @NotNull [] names,
                                            @NotNull final String pattern,
                                            final ProgressIndicator indicator,
                                            @NotNull final Consumer<? super MatchResult> consumer,
                                            boolean preferStartMatches) {
    MinusculeMatcher matcher = buildPatternMatcher(pattern, preferStartMatches);
    Processor<String> processor = name -> {
      ProgressManager.checkCanceled();
      MatchResult result = matches(base, pattern, matcher, name);
      if (result != null) {
        consumer.consume(result);
      }
      return true;
    };
    if (!JobLauncher.getInstance().invokeConcurrentlyUnderProgress(Arrays.asList(names), indicator, processor)) {
      throw new ProcessCanceledException();
    }
  }
private static void processNamesByPattern(@NotNull final ChooseByNameViewModel base,
                                            final String @NotNull [] names,
                                            @NotNull final String pattern,
                                            final ProgressIndicator indicator,
                                            @NotNull final Consumer<? super MatchResult> consumer,
                                            boolean preferStartMatches)