@Test
public void testApplyDelta() throws IOException {

  // Test all aspects of patch apply: copying, uncompressing and recompressing ranges.
  // This test uses the subclasses applier to apply the test patch to the old file, producing the
  // new file. Along the way the entry is uncompressed, altered by the testing delta applier, and
  // recompressed. It's deceptively simple below, but this is a lot of moving parts.
  ByteArrayOutputStream actualNewBlobOut = new ByteArrayOutputStream();
  fakeApplier.applyDelta(oldFile, new ByteArrayInputStream(patchBytes), actualNewBlobOut);
  Assert.assertArrayEquals(expectedNewBytes, actualNewBlobOut.toByteArray());
}