@Test
  public void testTravelModeWalking() throws Exception {
    try (LocalTestServerContext sc =
        new LocalTestServerContext("{\"routes\": [{}],\"status\": \"OK\"}")) {
      DirectionsResult result =
          DirectionsApi.newRequest(sc.context)
              .mode(TravelMode.WALKING)
              .origin("483 George St, Sydney NSW 2000, Australia")
              .destination("182 Church St, Parramatta NSW 2150, Australia")
              .await();

      assertNotNull(result.toString());
      assertNotNull(result.routes);
      assertNotNull(result.routes[0]);

      sc.assertParamValue(TravelMode.WALKING.toUrlValue(), "mode");
      sc.assertParamValue("483 George St, Sydney NSW 2000, Australia", "origin");
      sc.assertParamValue("182 Church St, Parramatta NSW 2150, Australia", "destination");

      assertNotNull(result.toString());
    }
  }
Test the extended transit parameters: mode and routing preference.
src/test/java/com/google/maps/DirectionsApiTest.java