### Question:
GridBase implements Grid, EventTarget { @Override public void spanColumn(int count, int rowIndex, int colIndex) { if (count <= 0 || count > columnCount || rowIndex >= getRowCount() || colIndex >= columnCount) { return; } final SpreadsheetCell cell = rows.get(rowIndex).get(colIndex); final int colSpan = count; final int rowSpan = cell.getRowSpan(); cell.setColumnSpan(colSpan); for (int row = rowIndex; row < rowIndex + rowSpan && row < getRowCount(); ++row) { for (int col = colIndex; col < colIndex + colSpan && col < columnCount; ++col) { if (row != rowIndex || col != colIndex) { rows.get(row).set(col, cell); } } } } GridBase(int rowCount, int columnCount); @Override ObservableList<ObservableList<SpreadsheetCell>> getRows(); @Override void setCellValue(int modelRow, int column, Object value); @Override int getRowCount(); @Override int getColumnCount(); @Override double getRowHeight(int row); void setRowHeightCallback(Callback<Integer, Double> rowHeight); @Override ObservableList<String> getRowHeaders(); @Override ObservableList<String> getColumnHeaders(); BooleanProperty lockedProperty(); boolean isLocked(); void setLocked(Boolean lock); @Override void spanRow(int count, int rowIndex, int colIndex); @Override void spanColumn(int count, int rowIndex, int colIndex); @Override void setRows(Collection<ObservableList<SpreadsheetCell>> rows); void setResizableRows(BitSet resizableRow); @Override boolean isRowResizable(int row); @Override boolean isDisplaySelection(); @Override void setDisplaySelection(boolean value); @Override BooleanProperty displaySelectionProperty(); @Override void setCellDisplaySelection(int row, int column, boolean displaySelection); @Override boolean isCellDisplaySelection(int row, int column); @Override void addEventHandler(EventType<E> eventType, EventHandler<E> eventHandler); @Override void removeEventHandler(EventType<E> eventType, EventHandler<E> eventHandler); @Override EventDispatchChain buildEventDispatchChain(EventDispatchChain tail);  }### Answer:
@Test public void testSpanColumn() { grid.spanColumn(0, 0, 0); assertEquals(1, grid.getRows().get(0).get(0).getColumnSpan()); grid.spanColumn(-1, -1, -1); grid.spanColumn(0, -1, 0); grid.spanColumn(0, 0, -1); grid.spanColumn(-1, 0, 0); grid.spanColumn(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); grid.spanColumn(2, grid.getRowCount(), grid.getColumnCount()); grid.spanColumn(1, 0, 0); assertEquals(1, grid.getRows().get(0).get(0).getColumnSpan()); grid.spanColumn(2, 0, 0); assertEquals(2, grid.getRows().get(0).get(0).getColumnSpan()); assertEquals(2, grid.getRows().get(0).get(1).getColumnSpan()); grid.spanColumn(3, 0, 0); SpreadsheetCell cell = grid.getRows().get(0).get(0); assertEquals(cell, grid.getRows().get(0).get(1)); assertEquals(cell, grid.getRows().get(0).get(2)); }