PsiElement (PsiClass aClass) { for (PsiMethod method : PsiTreeUtil.findChildrenOfType(aClass, PsiMethod.class)) { if (methodName.equals(method.getName())) { return method; } } throw new AssertionError(); }