boolean (@Nullable PsiClass containingClass, PsiClass aClass) { PsiMember member = aClass; while (member != null) { if (member.getContainingClass() == containingClass) { return member instanceof PsiField || member instanceof PsiMethod && ((PsiMethod)member).isConstructor() || member instanceof PsiClassInitializer; } member = PsiTreeUtil.getParentOfType(member, PsiMember.class, true); } return false; }