@Test
public void testConsistentHashing() {

    // Test that the byte buffer that is returned is consistent from JVM
    // session to JVM (e.g. it depends on persistent data).
    List<Integer> bytes = Lists.newArrayList(0, 1, -116, -58, -63, -90, 58,
            -104, 0, 67, 101, -107, 115, 59, 73, 102, 0, 0, 0, 1, -39, 33,
            58, 40);
    Object[] data = { Text.wrap("foo"),
            Value.wrap(Convert.javaToThrift("bar")), PrimaryKey.wrap(1) };
    ByteBuffer buf = TArrays.hash(data);
    System.out.println(buf);
    for (int i = 0; i < buf.capacity(); i++) {
        Assert.assertEquals(buf.get(), bytes.get(i).byteValue());
    }
}