@Test
public void testStreamingCopies() throws IOException {

    DefaultBinaryManager binaryManager = new DefaultBinaryManager();
    binaryManager.initialize(new BinaryManagerDescriptor());
    assertEquals(0, countFiles(binaryManager.getStorageDir()));
    File file = File.createTempFile("test-", ".data", binaryManager.getStorageDir());
    FileUtils.writeFile(file, CONTENT.getBytes("UTF-8"));
    FileSource source = new FileSource(file);
    binaryManager.storeAndDigest(source);
    assertFalse(file.exists());
    assertTrue(source.getFile().exists());
    binaryManager.close();
}