### Question:
GridCreator implements Iterable<GridCell> { public List<GridCell> getCells(GridCell cell) { Validate.notNull(cell, "cell must not be null"); List<GridCell> cells = new ArrayList<>(); for (double lat = cell.lat1; lat < cell.lat2; lat += gridSize) { for (double lng = cell.lng1; lng < cell.lng2; lng += gridSize) { lat = GeoUtils.normalizeLatitude(lat); lng = GeoUtils.normalizeLongitude(lng); cells.add(getCell(new ImmutableGeoCoordinate(lat, lng))); } } return cells; } GridCreator(double gridSize); @Deprecated String getCellIdentifier(GeoCoordinate coordinate); GridCell getCell(GeoCoordinate coordinate); List<GridCell> getCells(GridCell cell); @Deprecated GeoCoordinate getCoordinate(String cellIdentifier); GridCell getCell(String cellIdentifier); GridCell getCell(int xId, int yId); int getNumCells(); int getNumCellsY(); int getNumCellsX(); double getGridSize(); @Override Iterator<GridCell> iterator(); @Override String toString(); static void main(String[] args);  }### Answer:
@Test public void testGetCells() { GridCell cell = new GridCreator(90).getCell(c1); List<GridCell> cells = new GridCreator(45).getCells(cell); assertEquals(4, cells.size()); assertEquals(new ImmutableGeoCoordinate(-45, 90), cells.get(0).getNW()); assertEquals(new ImmutableGeoCoordinate(-45, 135), cells.get(1).getNW()); assertEquals(new ImmutableGeoCoordinate(0, 90), cells.get(2).getNW()); assertEquals(new ImmutableGeoCoordinate(0, 135), cells.get(3).getNW()); assertTrue(cell.intersects(cells.get(0))); assertTrue(cell.intersects(cells.get(1))); assertTrue(cell.intersects(cells.get(2))); assertTrue(cell.intersects(cells.get(3))); assertFalse(cell.intersects(new GridCreator(45).getCell(new ImmutableGeoCoordinate(45, 90)))); }