class TransportManager {

  protected void checkTransportGroup(List<Transport> group) {
    // order value must be different, otherwise, maybe will choose a random transport
    Map<Integer, Transport> orderMap = new HashMap<>();
    for (Transport transport : group) {
      Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport);
      if (existTransport != null) {
        throw new ServiceCombException(String.format("%s and %s have the same order %d",
            existTransport.getClass().getName(),
            transport.getClass().getName(),
            transport.getOrder()));
      }
    }
  }

}