@Nullable
  public static PsiClass getTopLevelClass(@NotNull PsiElement element) {
    PsiClass topClass = JBIterable.generate(element, PsiElement::getParent).takeWhile(e -> !(e instanceof PsiFile)).filter(PsiClass.class).last();
    return topClass instanceof PsiTypeParameter ? null : topClass;
  }
@Nullable
  public static PsiClass getTopLevelClass(@NotNull PsiElement element)