### Question:
CompressUtil { public static byte[] compressSnappy(byte[] data) throws IOException { if (data == null) { return new byte[0]; } return Snappy.compress(data); }  static byte[] compressGZip(byte[] data); static byte[] uncompressGZip(byte[] data); static byte[] compressSnappy(byte[] data); static byte[] uncompressSnappy(byte[] data);  }### Answer:
@Test public void testCompressSnappy() throws IOException { String message = "test dorado compress snappy"; byte[] compressData = CompressUtil.compressSnappy(message.getBytes()); byte[] data = CompressUtil.uncompressSnappy(compressData); Assert.assertEquals("test dorado compress snappy", new String(data)); compressData = CompressUtil.compressSnappy(null); try { CompressUtil.uncompressSnappy(compressData); } catch(Exception e) { Assert.assertTrue(e instanceof IOException); } }