for (int i = 0; i < 256; i++) {
test1[i] = (byte) (0xff & i);
test2[i] = (byte) (0xff & (255 - i));
}
ArrayByteSequence bs1 = new ArrayByteSequence(test1);
String ecf = LocalityGroupUtil.encodeColumnFamily(bs1);
// System.out.println(ecf);
ByteSequence bs2 = LocalityGroupUtil.decodeColumnFamily(ecf);
Assert.assertEquals(bs1, bs2);
Assert.assertEquals(ecf, LocalityGroupUtil.encodeColumnFamily(bs2));
// test encoding multiple column fams containing binary data
HashSet<Text> in = new HashSet<Text>();
HashSet<ByteSequence> in2 = new HashSet<ByteSequence>();
in.add(new Text(test1));
in2.add(new ArrayByteSequence(test1));
in.add(new Text(test2));
in2.add(new ArrayByteSequence(test2));
Set<ByteSequence> out = LocalityGroupUtil.decodeColumnFamilies(LocalityGroupUtil.encodeColumnFamilies(in));
Assert.assertEquals(in2, out);
}