public @NotNull PsiElement replaceAndRestoreComments(@NotNull PsiElement element, @NotNull @NlsSafe String text) {
    PsiElement replacement = createElementFromText(text, element);
    return replaceAndRestoreComments(element, replacement);
  }
public @NotNull PsiElement replaceAndRestoreComments(@NotNull PsiElement element, @NotNull @NlsSafe String text)