private static void wrapWithParentheses(PsiFile file, Document doc, int openingOffset, int closingOffset) {
    String space = CodeStyle.getLanguageSettings(file).SPACE_WITHIN_PARENTHESES ? " " : "";
    doc.insertString(closingOffset, space + ")");
    doc.insertString(openingOffset, "(" + space);
  }
private static void wrapWithParentheses(PsiFile file, Document doc, int openingOffset, int closingOffset)