private static void expandTemplate(@NotNull final PostfixTemplate template,
                                     @NotNull final Editor editor,
                                     @NotNull final PsiElement context) {
    PostfixTemplateLogger.log(template, context);
    if (template.startInWriteAction()) {
      ApplicationManager.getApplication().runWriteAction(() -> CommandProcessor.getInstance()
                                                                               .executeCommand(context.getProject(),
                                                                                               () -> template.expand(context, editor),
                                                                                               CodeInsightBundle.message("command.expand.postfix.template"),
                                                                                               POSTFIX_TEMPLATE_ID));
    }
    else {
      template.expand(context, editor);
    }
  }
private static void expandTemplate(@NotNull final PostfixTemplate template,
                                     @NotNull final Editor editor,
                                     @NotNull final PsiElement context)