PsiElement (PsiClass aClass) { final PsiAnonymousClass anonymousClass = PsiTreeUtil.findChildOfType(aClass, PsiAnonymousClass.class); assertNotNull(anonymousClass); return anonymousClass.findMethodsByName(methodName, false)[0]; }