public static void writeDocument(@NotNull Document document, @NotNull Path file) throws IOException {
    writeDocument(document, file, "\n");
  }
public static void writeDocument(@NotNull Document document, @NotNull Path file)