### Question:
Grid { @VisibleForTesting static BigDecimal getStartLat(Options options) { final long moveStartLatUpByCells; if (options.getFilterBounds().getTopLeftLat() == options.getOriginLat() .doubleValue()) moveStartLatUpByCells = 0; else moveStartLatUpByCells = Math.max(0, Math.round(Math.floor((options .getFilterBounds().getTopLeftLat() - options.getOriginLat() .doubleValue()) / options.getCellSizeDegrees().doubleValue()) + 1)); BigDecimal result = options.getOriginLat(); for (int i = 0; i < moveStartLatUpByCells; i++) result = result.add(options.getCellSizeDegrees()); return result; } 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 testStartLatGivenOriginLatEqualsTopLeftLatOfBoundsReturnsOriginLat() { assertEquals(0, Grid.getStartLat(builder.originLat(0.0).build()) .doubleValue(), PRECISION); }
@Test public void testStartLatGivenOriginLatAboveTopLeftLatOfBoundsReturnsOriginLat() { assertEquals(1.0, Grid.getStartLat(builder.originLat(1.0).build()) .doubleValue(), PRECISION); }
@Test public void testStartLatGivenOriginLatBelowTopLeftLatOfBoundsReturnsOriginLatMinusEnoughToGetAboveBounds() { assertEquals(0.1, Grid.getStartLat(builder.originLat(-1.0).build()) .doubleValue(), 0.000000000000000001); }