@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    PsiElement psiElement = BasicJavaAstTreeUtil.toPsi(astNode);
    if (psiElement instanceof PsiSwitchLabelStatement statement) {
      PsiSwitchBlock block = statement.getEnclosingSwitchBlock();
      if (block == null) return;
      String token = SwitchUtils.isRuleFormatSwitch(block) ? "->" : ":";
      if (!psiElement.getText().endsWith(token)) {
        PsiCaseLabelElementList labelElementList = statement.getCaseLabelElementList();
        if ((labelElementList != null && labelElementList.getElementCount() != 0) || statement.isDefaultCase()) {
          editor.getDocument().insertString(psiElement.getTextRange().getEndOffset(), token);
        }
      }
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)