Row shifting code is implemented in o.a.p.xssf.usermodel.helpers.XSSFRowShifter and o.a.p.hssf.usermodel.HSSFSheet. Some of the code is an exact copy-paste and all of the code is complicated enough that it warrants a standalone class. To avoid duplicated code, I suggest creating a RowShifter abstract class that implements the common behavior between XSSF and HSSF row shifting, and slowly migrating the methods related to row-shifting in HSSFSheet to HSSFRowShifter or just RowShifter.
r1749262 Added HSSFRowShifter and RowShifter classes, moved XSSFRowShifter#shiftMerged to RowShifter. All 3 of the row shifter classes need unit tests. Right now the only coverage is from TestXSSFSheetShiftRows and TestHSSFSheetShiftRows.