}
public void testSpliceSegmentsIntoSegmentPush() {
ArrayList<MemoryPostingNode> nodes = new ArrayList<MemoryPostingNode>();
MemoryPostingNode node3 = new MemoryPostingNode(3, new ArrayBytes(new byte[]{53}));
nodes.add(node3);
ArrayList<MemoryPostingNode> subnodes1 = new ArrayList<MemoryPostingNode>();
MemoryPostingNode node5 = new MemoryPostingNode(5, new ArrayBytes(new byte[]{53}));
subnodes1.add(node5);
MemoryPostingNode node6 = new MemoryPostingNode(6, new ArrayBytes(new byte[]{53}));
subnodes1.add(node6);
SegmentPush sub1 = new SegmentPush(subnodes1);
MemoryPostingNode node7 = new MemoryPostingNode(sub1, 7, new ArrayBytes(new byte[]{57}));
nodes.add(node7);
MemoryPostingNode node9 = new MemoryPostingNode(null, 9, new ArrayBytes(new byte[]{59}));
nodes.add(node9);
SegmentPush push = new SegmentPush(nodes);
SegmentPush o;
List<EditRec> edits = new ArrayList<EditRec>();
edits = new ArrayList<EditRec>();
edits.add(new EditRec(2, new ArrayBytes(new byte[]{0}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{2,3,5,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(9, new ArrayBytes(new byte[]{127}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,7,9,9});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(7, new ArrayBytes(new byte[]{0}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,7,7,9});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(3, new ArrayBytes(new byte[]{127}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,3,5,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(5, new ArrayBytes(new byte[]{127}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,5,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(6, new ArrayBytes(new byte[]{127}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(8, new ArrayBytes(new byte[]{127}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,7,8,9});
edits = new ArrayList<EditRec>();
edits.add(makeEdit(node3, true));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{5,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(makeEdit(node5, true));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(makeEdit(node6, true));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,7,9});
edits = new ArrayList<EditRec>();
edits.add(makeEdit(node7, true));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,9});
edits = new ArrayList<EditRec>();
edits.add(makeEdit(node9, true));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,7});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(2, new ArrayBytes(new byte[]{0}), false));
edits.add(makeEdit(node3, true));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{2,5,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(makeEdit(node3, true));
edits.add(new EditRec(4, new ArrayBytes(new byte[]{0}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{4,5,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(7, new ArrayBytes(new byte[]{0}), false));
edits.add(makeEdit(node7, true));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,7,9});
edits = new ArrayList<EditRec>();
edits.add(makeEdit(node9, true));
edits.add(new EditRec(10, new ArrayBytes(new byte[]{0}), false));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,7,10});
edits = new ArrayList<EditRec>();
edits.add(new EditRec(8, new ArrayBytes(new byte[]{0}), false));
edits.add(makeEdit(node9, true));
o = BlueSteelBagIndex.spliceEditsIntoSegmentPush(edits, push);
compareSegments(o, new long[]{3,5,6,7,8});
edits = new ArrayList<EditRec>();