/**
* Make sure the lzo index class works as described.
*/
public void testLzoIndex() {
LzoIndex index = new LzoIndex();
assertTrue(index.isEmpty());
index = new LzoIndex(4);
index.set(0, 0);
index.set(1, 5);
index.set(2, 10);
index.set(3, 15);
assertFalse(index.isEmpty());
assertEquals(0, index.findNextPosition(-1));
assertEquals(5, index.findNextPosition(1));
assertEquals(5, index.findNextPosition(5));
assertEquals(15, index.findNextPosition(11));
assertEquals(15, index.findNextPosition(15));
assertEquals(-1, index.findNextPosition(16));
assertEquals(5, index.alignSliceStartToIndex(3, 20));
assertEquals(15, index.alignSliceStartToIndex(15, 20));
assertEquals(10, index.alignSliceEndToIndex(8, 30));
assertEquals(10, index.alignSliceEndToIndex(10, 30));
assertEquals(30, index.alignSliceEndToIndex(17, 30));
assertEquals(LzoIndex.NOT_FOUND, index.alignSliceStartToIndex(16, 20));
}