public static PsiElement @NotNull [] findSuperElements(@NotNull PsiElement element) {
    if (element instanceof PsiClass aClass) {
      List<PsiClass> allSupers = new ArrayList<>(Arrays.asList(aClass.getSupers()));
      allSupers.removeIf(superClass -> CommonClassNames.JAVA_LANG_OBJECT.equals(superClass.getQualifiedName()));
      return allSupers.toArray(PsiClass.EMPTY_ARRAY);
    }
    if (element instanceof PsiMethod method) {
      if (method.isConstructor()) {
        PsiMethod constructorInSuper = JavaPsiConstructorUtil.findConstructorInSuper(method);
        if (constructorInSuper != null) {
          return new PsiMethod[]{constructorInSuper};
        }
      }
      else {
        PsiMethod[] superMethods = MethodSignatureUtil.convertMethodSignaturesToMethods(new ArrayList<>(
          SuperMethodsSearch.search(method, null, true, false).findAll()));
        if (superMethods.length == 0) {
          PsiMethod superMethod = getSiblingInheritedViaSubClass(method);
          if (superMethod != null) {
            superMethods = new PsiMethod[]{superMethod};
          }
        }
        return superMethods;
      }
    }
    return PsiElement.EMPTY_ARRAY;
  }
public static PsiElement @NotNull [] findSuperElements(@NotNull PsiElement element)