void (PsiClass klass, Processor<? super Pair<? extends PsiNamedElement, Integer>> processor) { GlobalSearchScope scope = getSearchScope(klass, false); PsiShortNamesCache cache = PsiShortNamesCache.getInstance(klass.getProject()); String klassName = klass.getName(); assert klassName != null; klassName = StringUtil.trimStart(klassName, JavaCodeStyleSettings.getInstance(klass.getContainingFile()).SUBCLASS_NAME_PREFIX); klassName = StringUtil.trimEnd(klassName, JavaCodeStyleSettings.getInstance(klass.getContainingFile()).SUBCLASS_NAME_SUFFIX); if (klassName.isEmpty()) { klassName = klass.getName(); } MinusculeMatcher matcher = NameUtil.buildMatcher("*" + klassName, NameUtil.MatchingCaseSensitivity.NONE); for (String eachName : ContainerUtil.newHashSet(cache.getAllClassNames())) { if (matcher.matches(eachName)) { for (PsiClass eachClass : cache.getClassesByName(eachName, scope)) { if (isTestClass(eachClass, klass) && !processor.process(Pair.create(eachClass, TestFinderHelper.calcTestNameProximity(klassName, eachName)))) { return; } } } } }