boolean (@NotNull PsiClass psiClass) { final Project project = psiClass.getProject(); final GlobalSearchScope resolveScope = psiClass.getResolveScope(); if (isControllerClassName(project, psiClass.getQualifiedName(), resolveScope)) { return true; } final Ref<Boolean> refFound = new Ref<>(false); ClassInheritorsSearch.search(psiClass, resolveScope, true, true, false).forEach((aClass) -> { if (isControllerClassName(project, aClass.getQualifiedName(), resolveScope)) { refFound.set(true); return false; } return true; }); return refFound.get(); }