@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    if (BasicJavaAstTreeUtil.is(astNode, BASIC_PARAMETER_LIST) ||
        BasicJavaAstTreeUtil.is(astNode, BASIC_ANNOTATION_PARAMETER_LIST)) {
      String text = astNode.getText();
      if (StringUtil.startsWithChar(text, '(') && !StringUtil.endsWithChar(text, ')')) {
        ASTNode[] params = BasicJavaAstTreeUtil.is(astNode, BASIC_PARAMETER_LIST) ?
                           BasicJavaAstTreeUtil.getParameterListParameters(astNode) :
                           BasicJavaAstTreeUtil.getAnnotationParameterListAttributes(astNode);
        int offset;
        if (params.length == 0) {
          offset = astNode.getTextRange().getStartOffset() + 1;
        }
        else {
          offset = params[params.length - 1].getTextRange().getEndOffset();
        }
        editor.getDocument().insertString(offset, ")");
      }
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)