@Test
  public void testGeocodeWithBounds() throws Exception {
    try (LocalTestServerContext sc =
        new LocalTestServerContext(
            "\n"
                + "{\n"
                + "   \"results\" : [\n"
                + "      {\n"
                + "         \"address_components\" : [\n"
                + "            {\n"
                + "               \"long_name\" : \"Winnetka\",\n"
                + "               \"short_name\" : \"Winnetka\",\n"
                + "               \"types\" : [ \"neighborhood\", \"political\" ]\n"
                + "            },\n"
                + "            {\n"
                + "               \"long_name\" : \"Los Angeles\",\n"
                + "               \"short_name\" : \"Los Angeles\",\n"
                + "               \"types\" : [ \"locality\", \"political\" ]\n"
                + "            },\n"
                + "            {\n"
                + "               \"long_name\" : \"Los Angeles County\",\n"
                + "               \"short_name\" : \"Los Angeles County\",\n"
                + "               \"types\" : [ \"administrative_area_level_2\", \"political\" ]\n"
                + "            },\n"
                + "            {\n"
                + "               \"long_name\" : \"California\",\n"
                + "               \"short_name\" : \"CA\",\n"
                + "               \"types\" : [ \"administrative_area_level_1\", \"political\" ]\n"
                + "            },\n"
                + "            {\n"
                + "               \"long_name\" : \"United States\",\n"
                + "               \"short_name\" : \"US\",\n"
                + "               \"types\" : [ \"country\", \"political\" ]\n"
                + "            }\n"
                + "         ],\n"
                + "         \"formatted_address\" : \"Winnetka, Los Angeles, CA, USA\",\n"
                + "         \"geometry\" : {\n"
                + "            \"bounds\" : {\n"
                + "               \"northeast\" : {\n"
                + "                  \"lat\" : 34.2355209,\n"
                + "                  \"lng\" : -118.5534191\n"
                + "               },\n"
                + "               \"southwest\" : {\n"
                + "                  \"lat\" : 34.1854649,\n"
                + "                  \"lng\" : -118.588536\n"
                + "               }\n"
                + "            },\n"
                + "            \"location\" : {\n"
                + "               \"lat\" : 34.2048586,\n"
                + "               \"lng\" : -118.5739621\n"
                + "            },\n"
                + "            \"location_type\" : \"APPROXIMATE\",\n"
                + "            \"viewport\" : {\n"
                + "               \"northeast\" : {\n"
                + "                  \"lat\" : 34.2355209,\n"
                + "                  \"lng\" : -118.5534191\n"
                + "               },\n"
                + "               \"southwest\" : {\n"
                + "                  \"lat\" : 34.1854649,\n"
                + "                  \"lng\" : -118.588536\n"
                + "               }\n"
                + "            }\n"
                + "         },\n"
                + "         \"place_id\" : \"ChIJ0fd4S_KbwoAR2hRDrsr3HmQ\",\n"
                + "         \"types\" : [ \"neighborhood\", \"political\" ]\n"
                + "      }\n"
                + "   ],\n"
                + "   \"status\" : \"OK\"\n"
                + "}\n")) {
      GeocodingResult[] results =
          GeocodingApi.newRequest(sc.context)
              .address("Winnetka")
              .bounds(new LatLng(34.172684, -118.604794), new LatLng(34.236144, -118.500938))
              .await()
              .results;

      assertNotNull(Arrays.toString(results));

      assertEquals("Winnetka, Los Angeles, CA, USA", results[0].formattedAddress);
      assertEquals("ChIJ0fd4S_KbwoAR2hRDrsr3HmQ", results[0].placeId);

      sc.assertParamValue("Winnetka", "address");
      sc.assertParamValue("34.17268400,-118.60479400|34.23614400,-118.50093800", "bounds");
    }
  }
Address geocode with bounds: <a
href="https://maps.googleapis.com/maps/api/geocode/json?address=Winnetka&bounds=34.172684,-118.604794|34.236144,-118.500938">
Winnetka within (34.172684,-118.604794) - (34.236144,-118.500938)</a>.
src/test/java/com/google/maps/GeocodingApiTest.java