PsiClass (PsiClass psiClass) { PsiClass topLevelClass = psiClass; while (topLevelClass != null && topLevelClass.getContainingClass() != null) { topLevelClass = topLevelClass.getContainingClass(); } return topLevelClass; }