@Test
public void addFilesRenamesExisting() throws TaskOutputVisitException, IOException {

    DefaultMultipleOutputWriter victim = new DefaultMultipleOutputWriter(ExistingOutputPolicy.FAIL, context);
    victim.addOutput(FileOutput.file(folder.newFile()).name("myName.pdf"));
    victim.addOutput(FileOutput.file(folder.newFile()).name("myName.pdf"));
    victim.addOutput(FileOutput.file(folder.newFile()).name("myName.pdf"));
    File outFolder = folder.newFolder();
    new DirectoryTaskOutput(outFolder).accept(victim);
    assertEquals(3, outFolder.list().length);
}