@Test
public void testInflate() {

  byte[] testData = TestUtil.buildTestData(/*arbitrary test data size*/ 256 * 1024);
  byte[] compressedData = new byte[testData.length * 2];
  Deflater compresser = new Deflater(9);
  compresser.setInput(testData);
  compresser.finish();
  int compressedDataLength = compresser.deflate(compressedData);
  compresser.end();
  ParsableByteArray input = new ParsableByteArray(compressedData, compressedDataLength);
  ParsableByteArray output = new ParsableByteArray();
  assertThat(Util.inflate(input, output, /* inflater= */ null)).isTrue();
  assertThat(output.limit()).isEqualTo(testData.length);
  assertThat(Arrays.copyOf(output.data, output.limit())).isEqualTo(testData);
}