@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    if (BasicJavaAstTreeUtil.is(astNode, BASIC_SWITCH_EXPRESSION) ||
        BasicJavaAstTreeUtil.is(astNode, BASIC_SWITCH_STATEMENT)
    ) {
      final Document doc = editor.getDocument();
      final ASTNode rParenth = BasicJavaAstTreeUtil.getRParenth(astNode);
      final ASTNode lParenth = BasicJavaAstTreeUtil.getLParenth(astNode);
      final ASTNode condition = BasicJavaAstTreeUtil.getExpression(astNode);

      if (condition == null) {
        if (lParenth == null || rParenth == null) {
          int stopOffset = doc.getLineEndOffset(doc.getLineNumber(astNode.getTextRange().getStartOffset()));
          final ASTNode block = BasicJavaAstTreeUtil.getCodeBlock(astNode);
          if (block != null) {
            stopOffset = Math.min(stopOffset, block.getTextRange().getStartOffset());
          }
          doc.replaceString(astNode.getTextRange().getStartOffset(), stopOffset, "switch ()");
        }
        else {
          processor.registerUnresolvedError(lParenth.getTextRange().getEndOffset());
        }
      }
      else if (rParenth == null) {
        doc.insertString(condition.getTextRange().getEndOffset(), ")");
      }
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)