PointToBoundsConverter { public LatLngBounds boundsFromPoint(LatLng point) { double minLat = point.getLatitude() - BOUNDS_RADIUS; double minLon = point.getLongitude() - BOUNDS_RADIUS; double maxLat = point.getLatitude() + BOUNDS_RADIUS; double maxLon = point.getLongitude() + BOUNDS_RADIUS; LatLng sw = new LatLng(minLat, minLon); LatLng ne = new LatLng(maxLat, maxLon); return new LatLngBounds(sw, ne); }  LatLngBounds boundsFromPoint(LatLng point); BoundingBox boundingBoxFromPoint(double latitude, double longitude);  }
@Test public void boundsFromPoint_shouldCreateCorrectBounds() throws Exception { LatLng point = new LatLng(40.0, 70.0); LatLngBounds bounds = pointConverter.boundsFromPoint(point); assertThat(bounds.getCenter().getLatitude()).isEqualTo(40.0); assertThat(bounds.getCenter().getLongitude()).isEqualTo(70.0); assertThat(bounds.getSouthwest().getLatitude()).isEqualTo(39.98); assertThat(bounds.getSouthwest().getLongitude()).isEqualTo(69.98); assertThat(bounds.getNortheast().getLatitude()).isEqualTo(40.02); assertThat(bounds.getNortheast().getLongitude()).isEqualTo(70.02); }