### Question:
CompressedArray { public static byte[] compress(byte[] value, int offset, int length, int compressionLevel) { ByteArrayOutputStream bos = new ByteArrayOutputStream(length); Deflater compressor = new Deflater(); try { compressor.setLevel(compressionLevel); compressor.setInput(value, offset, length); compressor.finish(); final byte[] buf = new byte[1024]; while (!compressor.finished()) { int count = compressor.deflate(buf); bos.write(buf, 0, count); } } finally { compressor.end(); } return bos.toByteArray(); } CompressedArray();  CompressedArray(int _segments, int entriesPerSeg, int approxBytesPerEntry); static byte[] compress(byte[] value, int offset, int length, int compressionLevel); static byte[] decompress(byte[] value); CompressedArray setCompressionLevel(int compressionLevel); void write(double lat, double lon); GHPoint get(long index); void flush(); float calcMemInMB();  }### Answer:
@Test public void testCompress() throws Exception { CompressedArray arr = new CompressedArray(); arr.write(10, 1); arr.write(11, 2); arr.write(12, 3); arr.flush(); GHPoint coord = arr.get(0); assertEquals(10, coord.lat, 1e-6); assertEquals(1, coord.lon, 1e-6); coord = arr.get(1); assertEquals(11, coord.lat, 1e-6); assertEquals(2, coord.lon, 1e-6); coord = arr.get(2); assertEquals(12, coord.lat, 1e-6); assertEquals(3, coord.lon, 1e-6); assertNull(arr.get(3)); }