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