List<TripUpdate> updatesForTrip = tripUpdatesByTripId.get(tripId.getId());
if (updatesForTrip != null) {
for (TripUpdate tripUpdate : updatesForTrip) {
if (tripUpdate.hasExtension(GtfsRealtimeOneBusAway.obaTripUpdate)) {
OneBusAwayTripUpdate obaTripUpdate = tripUpdate.getExtension(GtfsRealtimeOneBusAway.obaTripUpdate);
if (obaTripUpdate.hasDelay()) {
/**
* TODO: Improved logic around picking the "best" schedule deviation
*/
int delay = obaTripUpdate.getDelay();
best.delta = 0;
best.isInPast = false;
best.scheduleDeviation = delay;
}
if (obaTripUpdate.hasTimestamp()) {
best.timestamp = obaTripUpdate.getTimestamp() * 1000;
}
}
for (StopTimeUpdate stopTimeUpdate : tripUpdate.getStopTimeUpdateList()) {
BlockStopTimeEntry blockStopTime = getBlockStopTimeForStopTimeUpdate(