### Question:
GzipCompressor implements Compressor { @Override public byte[] decompress(byte[] compressed) { byte[] returnBuffer; byte[] buffer = new byte[2048]; int len; try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressed))) { while ((len = gzipInputStream.read(buffer)) > 0) { bos.write(buffer, 0, len); } gzipInputStream.close(); returnBuffer = bos.toByteArray(); bos.close(); Timber.v("compression saved %d byte", compressed.length - returnBuffer.length); return returnBuffer; } catch (Exception e) { throw new IllegalStateException("could not decompress gzip", e); } } GzipCompressor(); @Override byte[] decompress(byte[] compressed); @Override byte[] compress(byte[] uncompressed);  }### Answer:
@Test public void decompress() throws Exception { testCompressDecompress(1); testCompressDecompress(12); testCompressDecompress(128); testCompressDecompress(512); testCompressDecompress(2048); testCompressDecompress(8096); }