}
@Test
public void testCompact() {
Tuple t = new Tuple();
t.addAttribute("Hello world!");
Assert.assertTrue(t.getBytes().length == 256);
t.compact();
Assert.assertTrue(t.getBytes().length == 13);
byte[] ba = new byte[1024];
int[] of = {0};
t = new Tuple(ba, of, 0);
Assert.assertTrue(t.getBytes().length == 1024);
t.compact();
Assert.assertTrue(t.getBytes().length == 0);
ba = "attr1|attr2|3|4|attr5|thisdoesnotbelongtothetuple".getBytes();
int[] of2 = {0,6,12,14,16,22};
t = new Tuple(ba, of2, 5);
Assert.assertTrue(t.getBytes().length == ba.length);
t.compact();
Assert.assertTrue(t.getBytes().length == 22);
}