model.addRow("b", "1", "row-8");
model.addRow("b", "2", "row-9");
final MasterReport report = new MasterReport();
report.setPageDefinition(new SimplePageDefinition(new PageSize(500, 100)));
report.addGroup(new RelationalGroup());
report.setDataFactory(new TableDataFactory("query", model));
report.setQuery("query");
final RelationalGroup group0 = (RelationalGroup) report.getGroup(0);
group0.setName("outer-group");
group0.addField("g0");
group0.getHeader().addElement(createDataItem("outer-header-field", 100, 20));
group0.getFooter().addElement(createDataItem("outer-footer-field", 100, 20));
final RelationalGroup group1 = (RelationalGroup) report.getGroup(1);
group1.setName("inner-group");
group1.addField("g1");
group1.getHeader().addElement(createDataItem("inner-header-field", 100, 20));
group1.getFooter().addElement(createDataItem("inner-footer-field", 100, 20));
report.getItemBand().addElement(createFieldItem("detail-field", 100, 20));
report.getItemBand().getParentSection().getStyle().setStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE, Boolean.TRUE);
group1.getStyle().setStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE, Boolean.TRUE);
//PdfReportUtil.createPDF(report, "/tmp/WidowTest.pdf");
List<LogicalPageBox> pages = DebugReportRunner.layoutPages(report, 0, 1, 2, 3, 4, 5, 6, 7);
final LogicalPageBox page1 = pages.get(0);