}
public void testBalanceSegmentPush() {
SegmentPush o;
ArrayList<MemoryPostingNode> nodes = new ArrayList<MemoryPostingNode>();
nodes.add(new MemoryPostingNode(1L, new ArrayBytes(new byte[]{11})));
nodes.add(new MemoryPostingNode(2L, new ArrayBytes(new byte[]{22})));
nodes.add(new MemoryPostingNode(3L, new ArrayBytes(new byte[]{33})));
nodes.add(new MemoryPostingNode(4L, new ArrayBytes(new byte[]{44})));
nodes.add(new MemoryPostingNode(5L, new ArrayBytes(new byte[]{55})));
nodes.add(new MemoryPostingNode(6L, new ArrayBytes(new byte[]{66})));
nodes.add(new MemoryPostingNode(7L, new ArrayBytes(new byte[]{77})));
nodes.add(new MemoryPostingNode(8L, new ArrayBytes(new byte[]{88})));
nodes.add(new MemoryPostingNode(9L, new ArrayBytes(new byte[]{99})));
nodes.add(new MemoryPostingNode(10L,new ArrayBytes(new byte[]{00})));
SegmentPush push = new SegmentPush(nodes);
o=BlueSteelBagIndex.balanceSegmentPush(push, new ProbabilisticBalancingPolicy(4, 0.5f, 0.0f));
compareSegments(o, new long[]{1,2,3,4,5,6,7,8,9,10});
assertEquals(10, o.getCount());
assertEquals(3, o.getTopLevelCount());