XSSFSheet sheet = workbook.createSheet();
//one level
sheet.groupRow(9, 10);
assertEquals(2, sheet.getPhysicalNumberOfRows());
CTRow ctrow = sheet.getRow(9).getCTRow();
assertNotNull(ctrow);
assertEquals(10, ctrow.getR());
assertEquals(1, ctrow.getOutlineLevel());
assertEquals(1, sheet.getCTWorksheet().getSheetFormatPr().getOutlineLevelRow());
//two level
sheet.groupRow(10, 13);
assertEquals(5, sheet.getPhysicalNumberOfRows());
ctrow = sheet.getRow(10).getCTRow();
assertNotNull(ctrow);
assertEquals(11, ctrow.getR());
assertEquals(2, ctrow.getOutlineLevel());
assertEquals(2, sheet.getCTWorksheet().getSheetFormatPr().getOutlineLevelRow());
sheet.ungroupRow(8, 10);
assertEquals(4, sheet.getPhysicalNumberOfRows());