title: Comparing two ByteArrayOutputStreams in Java
body: <p>I'm writing output to an excel file which is being written through <code>ByteArrayOutputStream</code>. I want to write test for comparing the expected <code>ByteArrayOutputStream</code>(whether the excel cell contains the data as I required) with the output <code>ByteArrayOutputStream</code> .Is there a way to compare two <code>ByteArrayOutputStreams</code> in <code>Java</code> ? Also how should I set my expected outputStream ?</p>