PsiMethod (final String methodName, final ConvertContext context) { final CommonProcessors.FindFirstProcessor<PsiMethod> processor = new CommonProcessors.FindFirstProcessor<>(); processMethods(context, processor, s -> { final PsiMethod method = findMethod(s, methodName, getMethodParams(getParent(context))); if (method != null && acceptMethod(method, context)) { return new PsiMethod[]{method}; } return PsiMethod.EMPTY_ARRAY; }); if (processor.isFound()) return processor.getFoundValue(); processMethods(context, processor, s -> s.findMethodsByName(methodName, true)); return processor.getFoundValue(); }