@Test
  public void testTrafficModel() throws Exception {
    try (LocalTestServerContext sc =
        new LocalTestServerContext("{\"routes\": [{}],\"status\": \"OK\"}")) {
      DirectionsResult result =
          DirectionsApi.newRequest(sc.context)
              .origin("48 Pirrama Road, Pyrmont NSW 2009")
              .destination("182 Church St, Parramatta NSW 2150")
              .mode(TravelMode.DRIVING)
              .departureTime(Instant.now().plus(Duration.ofMinutes(2)))
              .trafficModel(TrafficModel.PESSIMISTIC)
              .await();

      sc.assertParamValue("48 Pirrama Road, Pyrmont NSW 2009", "origin");
      sc.assertParamValue("182 Church St, Parramatta NSW 2150", "destination");
      sc.assertParamValue(TravelMode.DRIVING.toUrlValue(), "mode");
      sc.assertParamValue(TrafficModel.PESSIMISTIC.toUrlValue(), "traffic_model");

      assertNotNull(result.toString());
    }
  }
Tests the {@code traffic_model} and {@code duration_in_traffic} parameters.
src/test/java/com/google/maps/DirectionsApiTest.java