@Test
  public void testSanFranciscoToSeattleByBicycleAvoidingIndoor() throws Exception {
    try (LocalTestServerContext sc =
        new LocalTestServerContext("{\"routes\": [{}],\"status\": \"OK\"}")) {
      DirectionsApi.newRequest(sc.context)
          .origin("San Francisco")
          .destination("Seattle")
          .avoid(RouteRestriction.INDOOR)
          .mode(TravelMode.BICYCLING)
          .await();

      sc.assertParamValue("San Francisco", "origin");
      sc.assertParamValue("Seattle", "destination");
      sc.assertParamValue(RouteRestriction.INDOOR.toUrlValue(), "avoid");
      sc.assertParamValue(TravelMode.BICYCLING.toUrlValue(), "mode");
    }
  }
Going from Toronto to Montreal by bicycle, avoiding highways.

<p>{@code
http://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&avoid=highways&mode=bicycling}
src/test/java/com/google/maps/DirectionsApiTest.java