private static boolean isPartOf(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);
    }
  }
private static boolean isPartOf(PsiClass elementClass, PsiClass containingClass)