### Question:
GridCreator implements Iterable<GridCell> { public GridCell getCell(GeoCoordinate coordinate) { Validate.notNull(coordinate, "coordinate must not be null"); int xId = (int)((coordinate.getLongitude() + 180) / gridSize); int yId = (int)((coordinate.getLatitude() + 90) / gridSize); xId = Math.min(xId, getNumCellsX()-1); yId = Math.min(yId, getNumCellsY()-1); double lat1 = Math.floor(coordinate.getLatitude() / gridSize) * gridSize + 0.; double lat2 = lat1 + gridSize; double lng1 = Math.floor(coordinate.getLongitude() / gridSize) * gridSize + 0.; double lng2 = lng1 + gridSize; return new GridCell(xId, yId, lat1, lat2, lng1, lng2, gridSize); } 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 testGetCell() { GridCreator gridCreator = new GridCreator(90); GridCell cell = gridCreator.getCell(c1); assertEquals(-90, cell.lat1, 0); assertEquals(0, cell.lat2, 0); assertEquals(90, cell.lng1, 0); assertEquals(180, cell.lng2, 0); assertEquals(new ImmutableGeoCoordinate(0, 180), cell.getNE()); assertEquals(new ImmutableGeoCoordinate(-90, 180), cell.getSE()); assertEquals(new ImmutableGeoCoordinate(0, 90), cell.getNW()); assertEquals(new ImmutableGeoCoordinate(-90, 90), cell.getSW()); }
@Test @Ignore public void testGetCellByIdentifier_performance() { StopWatch stopWatch = new StopWatch(); GridCreator gridCreator = new GridCreator(2.5); for (int i = 0; i < 1000000; i++) { gridCreator.getCell("(23|45)"); } System.out.println(stopWatch); }