@Override
  protected @NotNull Surrounder getSurrounder() {
    return new JavaExpressionModCommandSurrounder() {
      @Override
      public boolean isApplicable(PsiExpression expr) {
        return expr.isPhysical() && SWITCH_TYPE.value(expr);
      }

      @Override
      protected void surroundExpression(@NotNull ActionContext context, @NotNull PsiExpression expr, @NotNull ModPsiUpdater updater) {
        Project project = context.project();
        PsiElementFactory factory = JavaPsiFacade.getElementFactory(project);
        CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project);

        PsiElement parent = expr.getParent();
        updater.select(TextRange.from(context.offset(), 0));
        if (parent instanceof PsiExpressionStatement) {
          PsiSwitchStatement switchStatement = (PsiSwitchStatement)factory.createStatementFromText("switch(1){case 1:}", null);
          postprocessSwitch(updater, expr, codeStyleManager, parent, switchStatement);
        }
        else if (PsiUtil.isAvailable(JavaFeature.ENHANCED_SWITCH, expr)) {
          PsiSwitchExpression switchExpression = (PsiSwitchExpression)factory.createExpressionFromText("switch(1){case 1->1;}", null);
          postprocessSwitch(updater, expr, codeStyleManager, expr, switchExpression);
        }
      }

      private static void postprocessSwitch(@NotNull ModPsiUpdater updater,
                                            PsiExpression expr,
                                            CodeStyleManager codeStyleManager,
                                            PsiElement toReplace,
                                            PsiSwitchBlock switchBlock) {
        Document document = expr.getContainingFile().getFileDocument();
        switchBlock = (PsiSwitchBlock)codeStyleManager.reformat(switchBlock);
        PsiExpression selectorExpression = switchBlock.getExpression();
        if (selectorExpression != null) {
          selectorExpression.replace(expr);
        }

        switchBlock = (PsiSwitchBlock)toReplace.replace(switchBlock);

        PsiCodeBlock body = switchBlock.getBody();
        if (body != null) {
          body = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(body);
          if (body != null) {
            TextRange range = body.getStatements()[0].getTextRange();
            document.deleteString(range.getStartOffset(), range.getEndOffset());
            updater.select(TextRange.from(range.getStartOffset(), 0));
          }
        }
      }

      @Override
      public String getTemplateDescription() {
        return JavaBundle.message("switch.stmt.template.description");
      }
    };
  }
@Override
  protected @NotNull Surrounder getSurrounder()