boolean (PsiClass elementClass, PsiClass containingClass) { if (containingClass == null) return false; if (elementClass.equals(containingClass) || elementClass.isInheritor(containingClass, true)) { return true; } else { return PsiTreeUtil.isAncestor(containingClass, elementClass, true); } }