private static void findFunctionalExpressions( final List<UsageInfo> usages, PsiMethod... methods) { for (PsiMethod method : methods) { final PsiClass containingClass = method.getContainingClass(); FunctionalExpressionSearch.search(method) .forEach( expression -> { usages.add( new SafeDeleteFunctionalExpressionUsageInfo(expression, containingClass)); return true; }); } }
public static boolean processImplementations( final PsiClass psiClass, final Processor<PsiElement> processor, SearchScope scope) { final boolean showInterfaces = Registry.is("ide.goto.implementation.show.interfaces"); if (!ClassInheritorsSearch.search(psiClass, scope, true) .forEach( new PsiElementProcessorAdapter<>( element -> { if (!showInterfaces && element.isInterface()) { return true; } return processor.process(element); }))) { return false; } return FunctionalExpressionSearch.search(psiClass, scope) .forEach((Processor<PsiFunctionalExpression>) processor::process); }