private static int getNestingLevel(PsiClass aClass) {
      PsiElement ancestor = aClass.getParent();
      int nestingLevel = 0;
      while (ancestor != null) {
        if (ancestor instanceof PsiClass) {
          nestingLevel++;
        }
        ancestor = ancestor.getParent();
      }
      return nestingLevel;
    }
private static int getNestingLevel(PsiClass aClass)