public static boolean hasSealedParent(@NotNull PsiClass psiClass) {
    return StreamEx.of(psiClass.getExtendsListTypes())
      .append(psiClass.getImplementsListTypes())
      .map(r -> r.resolve())
      .anyMatch(parent -> parent != null && parent.hasModifierProperty(PsiModifier.SEALED));
  }
public static boolean hasSealedParent(@NotNull PsiClass psiClass)