ProgressIndicator (@NotNull Map<? extends SearchEverywhereContributor<?>, Collection<SearchEverywhereFoundElementInfo>> alreadyFound, @NotNull Map<? extends SearchEverywhereContributor<?>, Integer> contributorsAndLimits, @NotNull String pattern) { if (contributorsAndLimits.size() > 1) throw new IllegalArgumentException("Multiple contributors are not allowed for grouped list"); Map.Entry<? extends SearchEverywhereContributor<?>, Integer> entry = contributorsAndLimits.entrySet().stream().findFirst() .orElseThrow(() -> new IllegalArgumentException("Empty contributors map is not allowed")); SearchEverywhereContributor<?> contributor = entry.getKey(); int newLimit = entry.getValue(); ProgressIndicator indicator = new ProgressIndicatorBase(); ResultsAccumulator accumulator = new ShowMoreResultsAccumulator(alreadyFound, myEqualityProvider, contributor, newLimit, myListener, myNotificationExecutor, indicator); indicator.start(); accumulator.startSearch(pattern); Runnable task = createSearchTask(pattern, accumulator, indicator, contributor, () -> indicator.stop()); ApplicationManager.getApplication().executeOnPooledThread(task); return indicator; }