### Question:
Grid { public Optional<Cell> cellAt(double lat, double lon) { if (!options.getFilterBounds().contains(lat, lon)) return Optional.absent(); else { Long latIndex = latIndexes.get(lats.ceiling(lat)); Long lonIndex = lonIndexes.get(lons.floor(lon)); return Optional.of(new Cell(latIndex, lonIndex)); } } Grid(Options options); Optional<Cell> cellAt(double lat, double lon); double leftEdgeLongitude(Cell cell); double rightEdgeLongitude(Cell cell); double topEdgeLatitude(Cell cell); double topEdgeLatitude(long latIndex); double bottomEdgeLatitude(Cell cell); double centreLat(long latIndex); double centreLon(long lonIndex);  }### Answer:
@Test public void testCellAtIfLatAboveBoundsThrowsException() { Grid grid = new Grid(options); assertFalse(grid.cellAt(1, 1).isPresent()); }
@Test public void testCellAtIfLatBelowBoundsThrowsException() { Grid grid = new Grid(options); assertFalse(grid.cellAt(-61.0, 1).isPresent()); }
@Test public void testCellAtIfLonLeftOfBoundsReturnsAbsent() { Grid grid = new Grid(options); assertFalse(grid.cellAt(-1, -59).isPresent()); }
@Test public void testCellAtIfLonRightOfBoundsThrowsException() { Grid grid = new Grid(options); assertFalse(grid.cellAt(-1, 176).isPresent()); }