@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    PsiElement psiElement = BasicJavaAstTreeUtil.toPsi(astNode);
    if (!(psiElement instanceof PsiErrorElement) ||
        !((PsiErrorElement)psiElement).getErrorDescription().equals(JavaPsiBundle.message("expected.comma.or.rparen"))) {
      return;
    }
    PsiElement parent = psiElement.getParent();
    if (!(parent instanceof PsiExpressionList)) return;
    if (!hasRParenth(psiElement, parent)) return;
    PsiElement next = PsiTreeUtil.skipWhitespacesAndCommentsForward(psiElement);
    if (!(next instanceof PsiExpression)) return;
    PsiElement call = parent.getParent();
    if (call instanceof PsiCall) {
      PsiMethod method = ((PsiCall)call).resolveMethod();
      if (method != null) {
        PsiParameterList list = method.getParameterList();
        int count = list.getParametersCount();
        if (count == 0 || count == 1 && !method.isVarArgs()) return;
      }
    }
    editor.getDocument().insertString(psiElement.getTextOffset(), ",");
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)