LibraryProcessor { public void run(String booksFile, String salesFile, String statsFile) { try { run(new FileInputStream(booksFile), new FileInputStream(salesFile), new FileWriter(statsFile)); } catch (IOException e) { e.printStackTrace(); } }  static void main(String[] args); void run(String booksFile, String salesFile, String statsFile); void run(InputStream booksFile, InputStream salesFile, Writer writer);  }
@Test public void testProcess() throws SAXException, IOException { LibraryProcessor processor = new LibraryProcessor(); StringWriter statsWriter = new StringWriter(); processor.run(getClass().getResourceAsStream("/books.xml"), getClass().getResourceAsStream("/sales.xml"), statsWriter); XMLAssert.assertXMLEqual(new InputSource(getClass().getResourceAsStream("/stats-ref.xml")), new InputSource(new StringReader(statsWriter.toString()))); }