@Test
public void writesTransformedContentToOutputStream() throws Exception {

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    final String transformedContent = "<xml/>";
    doAnswer(doTransformation(out, transformedContent)).when(transformer).transform(same(source), isA(StreamResult.class));
    xsltStreamingOutput.write(out);
    assertEquals(transformedContent, out.toString());
}