@Test
public void writesFileToOutputStream() throws Exception {

    File source = FileCollector.getInstance().createFile();
    Files.write(testContent, source);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    fileEntityProvider.writeTo(source, File.class, null, null, null, null, out);
    assertArrayEquals(testContent, out.toByteArray());
}