Set<PsiClass> (@NotNull PsiClass psiClass, @NotNull GlobalSearchScope scope) { if (AnnotationTargetUtil.findAnnotationTarget(psiClass, PsiAnnotation.TargetType.ANNOTATION_TYPE, PsiAnnotation.TargetType.TYPE) == null) { return emptySet(); } String name = psiClass.getQualifiedName(); if (name == null) { return emptySet(); } Set<PsiClass> result = CollectionFactory.createCustomHashingStrategySet(HASHING_STRATEGY); AnnotatedElementsSearch.searchPsiClasses(psiClass, scope).forEach(processorResult -> { ProgressManager.checkCanceled(); if (processorResult.isAnnotationType()) { result.add(processorResult); } return true; }); if (result.isEmpty()) return emptySet(); return result; }