@Override
  public @NotNull PsiFragment createStringTemplateFragment(@NotNull String newText, @NotNull IElementType tokenType, @Nullable PsiElement context) {
    int index;
    if (tokenType == JavaTokenType.TEXT_BLOCK_TEMPLATE_BEGIN) {
      newText += "}\"\"\"";
      index = 0;
    }
    else if (tokenType == JavaTokenType.TEXT_BLOCK_TEMPLATE_MID) {
      newText = "\"\"\"\n\\{" + newText + "}\"\"\"";
      index = 1;
    }
    else if (tokenType == JavaTokenType.TEXT_BLOCK_TEMPLATE_END) {
      newText = "\"\"\"\n\\{" + newText;
      index = 1;
    }
    else if (tokenType == JavaTokenType.STRING_TEMPLATE_BEGIN) {
      newText += "}\"";
      index = 0;
    }
    else if (tokenType == JavaTokenType.STRING_TEMPLATE_MID) {
      newText = "\"\\{" + newText + "}\"";
      index = 1;
    }
    else if (tokenType == JavaTokenType.STRING_TEMPLATE_END) {
      newText = "\"\\{" + newText;
      index = 1;
    }
    else {
      throw new IllegalArgumentException();
    }
    PsiTemplateExpression expression = (PsiTemplateExpression)createExpressionFromText(newText, context);
    PsiTemplate template = expression.getTemplate();
    assert template != null;
    PsiFragment fragment = template.getFragments().get(index);
    GeneratedMarkerVisitor.markGenerated(fragment);
    return fragment;
  }
@Override
  public @NotNull PsiFragment createStringTemplateFragment(@NotNull String newText, @NotNull IElementType tokenType, @Nullable PsiElement context)