@Nullable
  private Document collectChangesBeforeCurrentSettingsAppliance(@NotNull Project project) {
    PsiFile psiFile = createFileFromText(project, myTextToReformat);
    prepareForReformat(psiFile);
    CodeStyle.runWithLocalSettings(
      project,
      mySettings,
      settings -> {
        settings.setRightMargin(getDefaultLanguage(), getAdjustedRightMargin());
        doReformat(project, psiFile);
      });
    return getDocumentBeforeChanges(project, psiFile);
  }
@Nullable
  private Document collectChangesBeforeCurrentSettingsAppliance(@NotNull Project project)