void (@NotNull ProgressIndicator indicator) { final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); final GlobalSearchScope allScope = GlobalSearchScope.allScope(project); final PsiClass functionalInterfaceClass = ReadAction.compute(() -> psiFacade.findClass(CommonClassNames.JAVA_LANG_FUNCTIONAL_INTERFACE, allScope)); if (functionalInterfaceClass != null) { AnnotatedMembersSearch.search(functionalInterfaceClass, ReadAction.compute(() -> element.getResolveScope())).forEach(consumer); } for (String functionalInterface : FUNCTIONAL_INTERFACES) { final PsiClass aClass = ReadAction.compute(() -> psiFacade.findClass(functionalInterface, element.getResolveScope())); if (aClass != null) { consumer.process(aClass); } } }