boolean (PsiClass superClass, PsiClass subClass, PsiMember member) { PsiClass elementClass = null; if (member instanceof PsiField || member instanceof PsiMethod) { elementClass = member.getContainingClass(); } if (elementClass == null) return false; if (superClass != null) { if (elementClass.isInheritor(superClass, true)) { return !superClass.getManager().areElementsEquivalent(superClass, elementClass); } return PsiTreeUtil.isAncestor(elementClass, subClass, false) && !PsiTreeUtil.isAncestor(elementClass, superClass, false); } else { return subClass.getManager().areElementsEquivalent(subClass, elementClass); } }