@Test(expected = Exception.class) public void styleBottomNullMatrix() throws Exception { DataSection section = mock(DataSection.class); StyleOption style = mock(StyleOption.class); doReturn(null).when(section).getMatrix(); Styler.styleSectionBottom(section, style); verifyNoMoreInteractions(section); }
public static void styleSectionBottom(DataSection section, StyleOption style) throws Exception { DataCell[][] cellMatrix = section.getMatrix(); if (cellMatrix == null) { throw new Exception(NO_MATRIX_ERR_MSG); } for (int x = 0; x <= section.getMaxX(); x++) { DataCell cell = cellMatrix[x][section.getMaxY()]; if (cell == null) { cell = new DataCell("", x, section.getMaxY()); section.addCell(cell); } cell.addStyle(style); } }
Styler { public static void styleSectionBottom(DataSection section, StyleOption style) throws Exception { DataCell[][] cellMatrix = section.getMatrix(); if (cellMatrix == null) { throw new Exception(NO_MATRIX_ERR_MSG); } for (int x = 0; x <= section.getMaxX(); x++) { DataCell cell = cellMatrix[x][section.getMaxY()]; if (cell == null) { cell = new DataCell("", x, section.getMaxY()); section.addCell(cell); } cell.addStyle(style); } } }
Styler { public static void styleSectionBottom(DataSection section, StyleOption style) throws Exception { DataCell[][] cellMatrix = section.getMatrix(); if (cellMatrix == null) { throw new Exception(NO_MATRIX_ERR_MSG); } for (int x = 0; x <= section.getMaxX(); x++) { DataCell cell = cellMatrix[x][section.getMaxY()]; if (cell == null) { cell = new DataCell("", x, section.getMaxY()); section.addCell(cell); } cell.addStyle(style); } }  }
Styler { public static void styleSectionBottom(DataSection section, StyleOption style) throws Exception { DataCell[][] cellMatrix = section.getMatrix(); if (cellMatrix == null) { throw new Exception(NO_MATRIX_ERR_MSG); } for (int x = 0; x <= section.getMaxX(); x++) { DataCell cell = cellMatrix[x][section.getMaxY()]; if (cell == null) { cell = new DataCell("", x, section.getMaxY()); section.addCell(cell); } cell.addStyle(style); } }  static void disallowBodyStyles(DataSection section); static void styleSectionBottom(DataSection section, StyleOption style); static void styleSectionBorder(DataSection section, StyleOption styleLeft, StyleOption styleRight); @SuppressWarnings({ "checkstyle:NPathComplexity", "checkstyle:CyclomaticComplexity" }) static void extendStyleHorizontally(DataSection section, StyleOption... styles); @SuppressWarnings({ "checkstyle:NPathComplexity", "checkstyle:CyclomaticComplexity" }) static void extendStyleVertically(DataSection section, StyleOption... styles); void style(DataCell dataCell, Cell cell, Workbook wBook); }
Styler { public static void styleSectionBottom(DataSection section, StyleOption style) throws Exception { DataCell[][] cellMatrix = section.getMatrix(); if (cellMatrix == null) { throw new Exception(NO_MATRIX_ERR_MSG); } for (int x = 0; x <= section.getMaxX(); x++) { DataCell cell = cellMatrix[x][section.getMaxY()]; if (cell == null) { cell = new DataCell("", x, section.getMaxY()); section.addCell(cell); } cell.addStyle(style); } }  static void disallowBodyStyles(DataSection section); static void styleSectionBottom(DataSection section, StyleOption style); static void styleSectionBorder(DataSection section, StyleOption styleLeft, StyleOption styleRight); @SuppressWarnings({ "checkstyle:NPathComplexity", "checkstyle:CyclomaticComplexity" }) static void extendStyleHorizontally(DataSection section, StyleOption... styles); @SuppressWarnings({ "checkstyle:NPathComplexity", "checkstyle:CyclomaticComplexity" }) static void extendStyleVertically(DataSection section, StyleOption... styles); void style(DataCell dataCell, Cell cell, Workbook wBook);  }