@Test
public void shouldCopyInputStreamContentToGivenOutput() throws IOException {

    byte[] inBytes = Files.toByteArray(Values.IMAGE1);
    TestInputStream in = new TestInputStream(new FileInputStream(Values.IMAGE1));
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    toTest.serialize(in, null, out);
    assertArrayEquals(inBytes, out.toByteArray());
    assertTrue(in.hasBeenClosed());        
}