@Test
  public void testTransitWithoutSpecifyingTime() throws Exception {
    try (LocalTestServerContext sc = new LocalTestServerContext("{\"status\" : \"OK\"}")) {
      String[] origins =
          new String[] {"Fisherman's Wharf, San Francisco", "Union Square, San Francisco"};
      String[] destinations =
          new String[] {"Mikkeller Bar, San Francisco", "Moscone Center, San Francisco"};
      DistanceMatrixApi.newRequest(sc.context)
          .origins(origins)
          .destinations(destinations)
          .mode(TravelMode.TRANSIT)
          .await();

      sc.assertParamValue(StringUtils.join(origins, "|"), "origins");
      sc.assertParamValue(StringUtils.join(destinations, "|"), "destinations");
      sc.assertParamValue(TravelMode.TRANSIT.toUrlValue(), "mode");
    }
  }
Test transit without arrival or departure times specified.
src/test/java/com/google/maps/DistanceMatrixApiTest.java