public DistanceMatrixApiRequest transitModes(TransitMode... transitModes) {
    return param("transit_mode", join('|', transitModes));
  }
Specifies one or more preferred modes of transit. This parameter may only be specified for
requests where the mode is transit.

@param transitModes The preferred transit modes.
@return Returns this {@code DistanceMatrixApiRequest} for call chaining.
src/main/java/com/google/maps/DistanceMatrixApiRequest.java