public static @NotNull List<@NotNull PsiClass> getAllPermittedClassesJvmAware(@NotNull PsiClass clazz) {
    if (clazz instanceof GrTypeDefinition) {
      return SealedUtil.getAllPermittedClasses((GrTypeDefinition)clazz);
    } else {
      return ContainerUtil.map(clazz.getPermitsListTypes(), PsiClassType::resolve);
    }
  }
public static @NotNull List<@NotNull PsiClass> getAllPermittedClassesJvmAware(@NotNull PsiClass clazz)