}
public ArrivalAndDepartureV2Bean getArrivalAndDeparture(
ArrivalAndDepartureBean ad) {
TripBean trip = ad.getTrip();
RouteBean route = trip.getRoute();
StopBean stop = ad.getStop();
ArrivalAndDepartureV2Bean bean = new ArrivalAndDepartureV2Bean();
bean.setTripId(trip.getId());
addToReferences(trip);
bean.setServiceDate(ad.getServiceDate());
bean.setVehicleId(ad.getVehicleId());
bean.setStopId(stop.getId());
addToReferences(stop);
bean.setStopSequence(ad.getStopSequence());
bean.setBlockTripSequence(ad.getBlockTripSequence());
bean.setRouteId(route.getId());
addToReferences(route);
String routeShortName = ad.getRouteShortName();
if (routeShortName == null || routeShortName.isEmpty())
routeShortName = trip.getRouteShortName();
if (routeShortName == null || routeShortName.isEmpty())
routeShortName = route.getShortName();
bean.setRouteShortName(routeShortName);
bean.setRouteLongName(route.getLongName());
String tripHeadsign = ad.getTripHeadsign();
if (tripHeadsign == null || tripHeadsign.isEmpty())
tripHeadsign = trip.getTripHeadsign();
bean.setTripHeadsign(tripHeadsign);
bean.setArrivalEnabled(ad.isArrivalEnabled());
bean.setDepartureEnabled(ad.isDepartureEnabled());