};
return new PrefixCompressedBagIndex(new TrivialBagIndex(), mapping);
}
public void testSlotBuffer() {
SlotBuffer buf = new SlotBuffer();
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString(""), 20));
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString("abc"), 12));
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString("abcx"), 2));
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString("abcy"), 5));
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString("a"), 0));
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString("b"), 1));
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString(""), 2));
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString("f"), 8));
buf.slots.add(new SlotBufferItem(ArrayBytes.fromString(""), 4));
buf.collapse(4, 35);
//System.out.println(buf.slots);
List<SlotBufferItem> items = buf.slots;
assertEquals(4, items.size());
assertEquals(ArrayBytes.fromString(""), items.get(0).bytes);
assertEquals(20, items.get(0).hits);