BaseGridRenderer implements GridRenderer { void addRenderHighlightedCellsCommand(final GridData model, final GridBodyRenderContext context, final BaseGridRendererHelper rendererHelper, final BaseGridRendererHelper.RenderingInformation renderingInformation, final List<RendererCommand> commands) { if (!Objects.isNull(getHighlightCellColumnIndex()) && !Objects.isNull(getHighlightCellRowIndex())) { commands.add(renderHighlightedCells(model, context, rendererHelper, renderingInformation)); } } BaseGridRenderer(final GridRendererTheme theme); @Override double getHeaderHeight(); @Override double getHeaderRowHeight(); @Override GridRendererTheme getTheme(); @Override void setTheme(final GridRendererTheme theme); @Override RendererCommand renderSelector(final double width,
                                          final double height,
                                          final BaseGridRendererHelper.RenderingInformation renderingInformation); @Override RendererCommand renderSelectedCells(final GridData model,
                                               final GridBodyRenderContext context,
                                               final BaseGridRendererHelper rendererHelper,
                                               final List<GridData.SelectedCell> selectedCells,
                                               final BiFunction<SelectedRange, Integer, Double> selectedCellsYOffsetStrategy,
                                               final Function<SelectedRange, Double> selectedCellsHeightStrategy); @Override List<RendererCommand> renderHeader(final GridData model,
                                              final GridHeaderRenderContext context,
                                              final BaseGridRendererHelper rendererHelper,
                                              final BaseGridRendererHelper.RenderingInformation renderingInformation); @Override RendererCommand renderHeaderBodyDivider(final double width); @Override List<RendererCommand> renderBody(final GridData model,
                                            final GridBodyRenderContext context,
                                            final BaseGridRendererHelper rendererHelper,
                                            final BaseGridRendererHelper.RenderingInformation renderingInformation); @Override RendererCommand renderGridBoundary(final GridBoundaryRenderContext context); @Override boolean onGroupingToggle(double cellX,
                                    double cellY,
                                    double cellWidth,
                                    double cellHeight); @Override void setColumnRenderConstraint(final BiFunction<Boolean, GridColumn<?>, Boolean> columnRenderingConstraint); void clearCellHighlight(); void highlightCell(final int column, final int row); Integer getHighlightCellColumnIndex(); Integer getHighlightCellRowIndex();  }
@Test public void testAddRenderHighlightedCellsCommand() { final GridData dataModel = mock(GridData.class); final RenderingInformation renderingInformation = mock(RenderingInformation.class); final List<GridRenderer.RendererCommand> commands = mock(List.class); final int columnIndex = 1; final int rowIndex = 1; final GridRenderer.RendererCommand cmd = mock(GridRenderer.RendererCommand.class); doReturn(columnIndex).when(renderer).getHighlightCellColumnIndex(); doReturn(rowIndex).when(renderer).getHighlightCellRowIndex(); doReturn(cmd).when(renderer).renderHighlightedCells(dataModel, context, rendererHelper, renderingInformation); renderer.addRenderHighlightedCellsCommand(dataModel, context, rendererHelper, renderingInformation, commands); verify(commands).add(cmd); }