public static @NotNull List<PsiClassType> getUnhandledProcessorExceptions(@NotNull PsiTemplateExpression templateExpression,
                                                                   @Nullable PsiElement topElement) {
    if (!PsiUtil.getLanguageLevel(templateExpression).equals(LanguageLevel.JDK_21_PREVIEW)) {
      return getUnhandledExceptions(templateExpression, topElement, c -> false);
    }
    PsiExpression processor = templateExpression.getProcessor();
    if (processor == null) return Collections.emptyList();
    PsiType type = processor.getType();
    List<PsiClassType> result = new ArrayList<>();
    for (PsiClassType classType : PsiTypesUtil.getClassTypeComponents(type)) {
      // Currently, a generic parameter type is considered as unhandled exception; not actual exceptions declared by 'process' method
      PsiType substituted = PsiUtil.substituteTypeParameter(classType, CommonClassNames.JAVA_LANG_STRING_TEMPLATE_PROCESSOR, 1, false);
      if (substituted instanceof PsiCapturedWildcardType) {
        PsiCapturedWildcardType wildcardType = (PsiCapturedWildcardType)substituted;
        substituted = wildcardType.getUpperBound();
      }
      if (!(substituted instanceof PsiClassType)) continue;
      PsiClassType exceptionType = (PsiClassType)substituted;
      if (!isUncheckedException(exceptionType) &&
          getHandlePlace(templateExpression, exceptionType, topElement) == HandlePlace.UNHANDLED) {
        result.add(exceptionType);
      }
    }
    return result;
  }
public static @NotNull List<PsiClassType> getUnhandledProcessorExceptions(@NotNull PsiTemplateExpression templateExpression,
                                                                   @Nullable PsiElement topElement)