@Override
  public void dumpAsCsv(ScoreMatrix scoreMatrix) {
    if (configuration.getBoolean("sonar.filemove.dumpCsv").orElse(false)) {
      try {
        Path tempFile = fs.getTempDir().toPath()
          .resolve(String.format("score-matrix-%s.csv", ceTask.getUuid()));
        try (BufferedWriter writer = Files.newBufferedWriter(tempFile, UTF_8)) {
          writer.write(scoreMatrix.toCsv(';'));
        }
        LOG.info("File move similarity score matrix dumped as CSV: {}", tempFile);
      } catch (IOException e) {
        LOG.error("Failed to dump ScoreMatrix as CSV", e);
      }
    }
  }
@Test
  public void dumpAsCsv_creates_csv_dump_of_score_matrix_if_property_is_true() throws IOException {
    String taskUuid = "acme";
    when(ceTask.getUuid()).thenReturn(taskUuid);
    settings.setProperty("sonar.filemove.dumpCsv", "true");

    underTest.dumpAsCsv(A_SCORE_MATRIX);

    Collection<File> files = listDumpFilesForTaskUuid(taskUuid);
    assertThat(files).hasSize(1);
    assertThat(files.iterator().next()).hasContent(A_SCORE_MATRIX.toCsv(';'));
  }