boolean (PsiMethod method, PsiClass containingClass) { if (containingClass == null || method.hasModifierProperty(PsiModifier.STATIC)) { return false; } final PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(method.getReturnType()); return containingClass.equals(aClass); }