### Question:
Grid { @VisibleForTesting static BigDecimal getStartLon(Options options) { final long moveStartLonLeftByCells; if (options.getFilterBounds().getTopLeftLon() == options.getOriginLon() .doubleValue()) moveStartLonLeftByCells = 0; else { moveStartLonLeftByCells = Math.max(0, Math.round(Math .floor((options.getOriginLon().doubleValue() - options .getFilterBounds().getTopLeftLon()) / options.getCellSizeDegrees().doubleValue()) + 1)); } BigDecimal result = options.getOriginLon(); for (int i = 0; i < moveStartLonLeftByCells; i++) result = result.subtract(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 testStartLonGivenOriginLonEqualsTopLeftLonOfBoundsReturnsOriginLon() { assertEquals(100, Grid.getStartLon(builder.originLon(100).build()) .doubleValue(), PRECISION); }
@Test public void testStartLonGivenOriginLonLeftOfTopLeftLonOfBoundsReturnsOriginLon() { assertEquals(99.0, Grid.getStartLon(builder.originLon(99.0).build()) .doubleValue(), PRECISION); }
@Test public void testStartLonGivenOriginLonRightOfTopLeftLonOfBoundsReturnsOriginLonMinusEnoughToGetLeftOfBounds() { assertEquals(99.9, Grid.getStartLon(builder.originLon(101.0).build()) .doubleValue(), 0.000000000000000001); }