@VisibleForTesting
  static void writeFileConservatively(Path file, String content) throws IOException {
    if (Files.exists(file)) {
      String oldContent = new String(Files.readAllBytes(file), StandardCharsets.UTF_8);
      if (oldContent.equals(content)) {
        return;
      }
    }
    Files.createDirectories(file.getParent());
    Files.write(file, content.getBytes(StandardCharsets.UTF_8));
  }
@Test
  public void testWriteFileConservatively_noWriteIfUnchanged() throws IOException {
    Path file = temporaryFolder.newFile().toPath();
    Files.write(file, "some content".getBytes(StandardCharsets.UTF_8));
    FileTime fileTime = Files.getLastModifiedTime(file);

    PluginConfigurationProcessor.writeFileConservatively(file, "some content");

    String content = new String(Files.readAllBytes(file), StandardCharsets.UTF_8);
    assertThat(content).isEqualTo("some content");
    assertThat(Files.getLastModifiedTime(file)).isEqualTo(fileTime);
  }