@Test
  public void testGeocodeWithRegionBiasing() throws Exception {
    try (LocalTestServerContext sc =
        new LocalTestServerContext(
            "\n"
                + "{\n"
                + "   \"results\" : [\n"
                + "      {\n"
                + "         \"address_components\" : [\n"
                + "            {\n"
                + "               \"long_name\" : \"Toledo\",\n"
                + "               \"short_name\" : \"Toledo\",\n"
                + "               \"types\" : [ \"locality\", \"political\" ]\n"
                + "            },\n"
                + "            {\n"
                + "               \"long_name\" : \"Toledo\",\n"
                + "               \"short_name\" : \"TO\",\n"
                + "               \"types\" : [ \"administrative_area_level_2\", \"political\" ]\n"
                + "            },\n"
                + "            {\n"
                + "               \"long_name\" : \"Castile-La Mancha\",\n"
                + "               \"short_name\" : \"CM\",\n"
                + "               \"types\" : [ \"administrative_area_level_1\", \"political\" ]\n"
                + "            },\n"
                + "            {\n"
                + "               \"long_name\" : \"Spain\",\n"
                + "               \"short_name\" : \"ES\",\n"
                + "               \"types\" : [ \"country\", \"political\" ]\n"
                + "            }\n"
                + "         ],\n"
                + "         \"formatted_address\" : \"Toledo, Spain\",\n"
                + "         \"geometry\" : {\n"
                + "            \"bounds\" : {\n"
                + "               \"northeast\" : {\n"
                + "                  \"lat\" : 39.88605099999999,\n"
                + "                  \"lng\" : -3.9192423\n"
                + "               },\n"
                + "               \"southwest\" : {\n"
                + "                  \"lat\" : 39.8383676,\n"
                + "                  \"lng\" : -4.0796176\n"
                + "               }\n"
                + "            },\n"
                + "            \"location\" : {\n"
                + "               \"lat\" : 39.8628316,\n"
                + "               \"lng\" : -4.027323099999999\n"
                + "            },\n"
                + "            \"location_type\" : \"APPROXIMATE\",\n"
                + "            \"viewport\" : {\n"
                + "               \"northeast\" : {\n"
                + "                  \"lat\" : 39.88605099999999,\n"
                + "                  \"lng\" : -3.9192423\n"
                + "               },\n"
                + "               \"southwest\" : {\n"
                + "                  \"lat\" : 39.8383676,\n"
                + "                  \"lng\" : -4.0796176\n"
                + "               }\n"
                + "            }\n"
                + "         },\n"
                + "         \"place_id\" : \"ChIJ8f21C60Lag0R_q11auhbf8Y\",\n"
                + "         \"types\" : [ \"locality\", \"political\" ]\n"
                + "      }\n"
                + "   ],\n"
                + "   \"status\" : \"OK\"\n"
                + "}\n")) {
      GeocodingResult[] results =
          GeocodingApi.newRequest(sc.context).address("Toledo").region("es").await().results;

      assertNotNull(Arrays.toString(results));

      assertNotNull(results);
      assertEquals("Toledo, Spain", results[0].formattedAddress);
      assertEquals(AddressType.LOCALITY, results[0].types[0]);
      assertEquals(AddressType.POLITICAL, results[0].types[1]);

      sc.assertParamValue("Toledo", "address");
      sc.assertParamValue("es", "region");
    }
  }
Geocode with region biasing: <a
href="https://maps.googleapis.com/maps/api/geocode/json?address=Toledo&region=es">Geocode for
Toledo in Spain</a>.
src/test/java/com/google/maps/GeocodingApiTest.java