}
public void testRowShifting ()
{
InitialPaginationShiftState init = new InitialPaginationShiftState();
RowLevelPaginationShiftState stateR1 = new RowLevelPaginationShiftState();
stateR1.reuse(null, init, null);
stateR1.increaseShift(10);
stateR1.pop(null);
assertEquals(10, init.getShiftForNextChild());
RowLevelPaginationShiftState stateR2 = new RowLevelPaginationShiftState();
stateR2.reuse(null, init, null);
stateR2.increaseShift(10);
BlockLevelPaginationShiftState stateCC1 = new BlockLevelPaginationShiftState();
stateCC1.reuse(null, stateR2, null);
assertEquals(20, stateCC1.getShiftForNextChild());
stateCC1.increaseShift(3);
stateCC1.pop(null);
assertEquals(20, stateR2.getShiftForNextChild());
BlockLevelPaginationShiftState stateCC2 = new BlockLevelPaginationShiftState();
stateCC2.reuse(null, stateR2, null);
assertEquals(20, stateCC2.getShiftForNextChild());
stateCC2.increaseShift(7);
stateCC2.pop(null);
assertEquals(20, stateR2.getShiftForNextChild());
stateR2.pop(null);
assertEquals(27, init.getShiftForNextChild());
}