private static @NotNull Document getOriginal(@NotNull Document document) {
    Document result = document.getUserData(ORIGINAL_DOCUMENT);
    return result == null ? document : result;
  }
private static @NotNull Document getOriginal(@NotNull Document document)