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