void (@NotNull final PrefixMatcher prefixMatcher, @NotNull Project project, @NotNull GlobalSearchScope scope, @NotNull Processor<? super PsiClass> processor) { final Set<String> names = new HashSet<>(10000); AllClassesSearchExecutor.processClassNames(project, scope, s -> { if (prefixMatcher.prefixMatches(s)) { names.add(s); } return true; }); LinkedHashSet<String> sorted = prefixMatcher.sortMatching(names); AllClassesSearchExecutor.processClassesByNames(project, scope, sorted, processor); }