int (@NotNull PsiClass aClass) { if (aClass.hasModifierProperty(PsiModifier.FINAL)) { return 0; } if (CommonClassNames.JAVA_LANG_OBJECT.equals(aClass.getQualifiedName())) { return 0; // It's useless to have overridden markers for object. } AtomicInteger count = new AtomicInteger(); ClassInheritorsSearch.INSTANCE.createQuery(new ClassInheritorsSearch.SearchParameters(aClass, aClass.getUseScope(), true, true, true)) .forEach((Consumer<? super PsiClass>)__ -> count.incrementAndGet()); return count.get(); }