@Test
public void copyStreamSingleFile() throws IOException {

    File tempFile = folder.newFile();
    Map<String, File> files = new HashMap<String, File>();
    files.put("newName", tempFile);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    OutputWriterHelper.copyToStream(files.values().iterator().next(), out);
    assertFalse("temporary file not deleted", tempFile.exists());
    assertEquals(out.size(), tempFile.length());
}