PackedByteArray { public static byte[] packComparable(byte[]... arrays) { return packComparable(Arrays.asList(arrays)); }  static byte[] pack(byte[]... arrays); static byte[] readByteArray(DataInput in, byte terminalDelimiter); static List<byte[]> readByteArrayList(DataInput in, byte delimiter, byte terminalDelimiter); static byte[] packComparable(byte[]... arrays); static byte[] packComparable(List<byte[]> arrays); static byte[] packComparable(List<byte[]> arrays, byte delimiter, byte terminalDelimiter); static List<byte[]> unpackComparable(byte[] packedArray); static List<byte[]> unpackComparable(
      byte[] packedArray, byte delimiter, byte terminalDelimiter); static byte[] pack(List<byte[]> arrays); static byte[][] unpack(byte[] packedArray); static byte[] getElement(byte[] packedArray, int pos); static int byteToIntAlt(byte[] bytes, int i); static byte[] byteListToArray(List<Byte> byteList); static int byteToInt(byte[] bytes, int offset);  }
@Test(groups = "fast") public void testCompare1() throws Exception { byte[] bytes1 = PackedByteArray.packComparable(original[0]); byte[] bytes2 = PackedByteArray.packComparable(original[1]); Assert.assertEquals(Lists.compareArrays(bytes1, bytes2), -1); }
@Test(groups = "fast") public void testCompare2() throws Exception { byte[] bytes1 = PackedByteArray.packComparable(original[1]); byte[] bytes2 = PackedByteArray.packComparable(original[5], original[6]); Assert.assertEquals(Lists.compareArrays(bytes1, bytes2), 1); }