### Question:
SmooksSAXFilter extends Filter { public void doFilter() throws SmooksException { Source source = FilterSource.getSource(executionContext); Result result = FilterResult.getResult(executionContext, StreamResult.class); doFilter(source, result); } SmooksSAXFilter(ExecutionContext executionContext); void doFilter(); void cleanup();  }### Answer:
@Test public void doFilter_verify_that_flush_is_called() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); StreamResult result = new StreamResult( baos ); saxFilter.doFilter( new StreamSource( new ByteArrayInputStream( input ) ), result ); OutputStream outputStream = result.getOutputStream(); assertTrue( outputStream instanceof ByteArrayOutputStream ); byte[] byteArray = ((ByteArrayOutputStream)outputStream).toByteArray(); assertTrue ( byteArray.length > 0 ); }