CaretModel caretModel = editor.getCaretModel();
int startOffset = insertionContext.getStartOffset();
char completionChar = insertionContext.getCompletionChar();
int endOffset = startOffset + lookupElement.getLookupString().length();
document.insertString(endOffset, "()");
if (completionChar == ' ') {
caretModel.moveCaretRelatively(3, 0, false, false, false);
} else {
caretModel.moveCaretRelatively(1, 0, false, false, false);