@Test
public void testApplyDelta_DoesntCloseStream() throws IOException {

  // Test for https://github.com/andrewhayden/archive-patcher/issues/6
  final AtomicBoolean closed = new AtomicBoolean(false);
  ByteArrayOutputStream actualNewBlobOut = new ByteArrayOutputStream() {
    @Override
    public void close() throws IOException {
      closed.set(true);
    }
  };
  fakeApplier.applyDelta(oldFile, new ByteArrayInputStream(patchBytes), actualNewBlobOut);
  Assert.assertArrayEquals(expectedNewBytes, actualNewBlobOut.toByteArray());
  Assert.assertFalse(closed.get());
}