@Test
public void testWriteToFileOutputsSingleJsonOrHtmlFileIfPresentInSettings() throws Exception {

    String outputPrefix = tempFile.toString();
    Set<OutputFormat> singleFileFormats = EnumSet.of(OutputFormat.JSON, OutputFormat.HTML);
    OutputSettings settings = OutputSettings.builder()
            .outputPrefix(outputPrefix)
            .outputFormats(singleFileFormats)
            .build();
    Analysis analysis = Analysis.builder().build();
    AnalysisResultsWriter.writeToFile(analysis, newAnalysisResults(), settings);
    for (OutputFormat outputFormat : singleFileFormats) {
        Path outputPath = Paths.get(String.format("%s.%s", outputPrefix, outputFormat.getFileExtension()));
        assertThat(outputPath.toFile().exists(), is(true));
        assertThat(outputPath.toFile().delete(), is(true));
    }
}