### Question:
SmooksDOMFilter extends Filter { public void doFilter() throws SmooksException { Source source = FilterSource.getSource(executionContext); Result result; result = FilterResult.getResult(executionContext, StreamResult.class); if(result == null) { result = FilterResult.getResult(executionContext, DOMResult.class); } doFilter(source, result); } SmooksDOMFilter(ExecutionContext executionContext); void doFilter(); void cleanup(); Node filter(Source source); Node filter(Document doc); Node filter(Element element); void serialize(Node node, Writer writer); static final String DELIVERY_NODE_REQUEST_KEY; }### Answer:
@Test public void doFilter_verify_that_flush_is_called() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); StreamResult result = new StreamResult( baos ); domFilter.doFilter( new StreamSource( new ByteArrayInputStream( input ) ), result ); OutputStream outputStream = result.getOutputStream(); assertTrue( outputStream instanceof ByteArrayOutputStream ); byte[] byteArray = ((ByteArrayOutputStream)outputStream).toByteArray(); assertTrue ( byteArray.length > 0 ); }