### Question:
CellGrid { @SuppressWarnings("unchecked") public List<C> getCells() { return getCells(CellFilter.ALL); } @SuppressWarnings("unchecked") private  CellGrid(GridDef gridDef, CellFactory<? extends C> cellFactory); static CellGrid<C> create(GridDef gridDef, CellFactory<? extends C> cellFactory); int getWidth(); int getHeight(); GridDef getGridDef(); CellFactory<? extends C> getCellFactory(); C getCellSafe(int x, int y); C getCell(int x, int y); void setCell(C cell); void setCell(int x, int y, C cell); C createCell(int x, int y); @SuppressWarnings("unchecked") List<C> getCells(); List<C> getCells(CellFilter<C> filter);  }### Answer:
@Test public void testGetCells() throws Exception { CellGrid<MyCell> grid = createGrid(GridDef.createGlobal(5.0)); List<MyCell> cells = grid.getCells(); assertNotNull(cells); assertEquals(0, cells.size()); grid.getCellSafe(0, 9); grid.getCellSafe(10, 2); grid.getCellSafe(12, 25); grid.getCellSafe(7, 3); cells = grid.getCells(); assertNotNull(cells); assertEquals(4, cells.size()); assertSame(grid.getCell(10, 2), cells.get(0)); assertSame(grid.getCell(7, 3), cells.get(1)); assertSame(grid.getCell(0, 9), cells.get(2)); assertSame(grid.getCell(12, 25), cells.get(3)); }