// A sign that FrequencyEntries and TripTimes need a common interface.
FrequencyEntry bestFreq = null;
for (FrequencyEntry freq : frequencyEntries) {
TripTimes tt = freq.tripTimes;
if ( ! serviceDay.serviceRunning(tt.serviceCode)) continue; // TODO merge into call on next line
if ( ! tt.tripAcceptable(s0, stopIndex)) continue;
int adjustedTime = adjustTimeForTransfer(s0, currentStop, tt.trip, boarding, serviceDay, time);
if (adjustedTime == -1) continue;
LOG.debug(" running freq {}", freq);
if (boarding) {
int depTime = freq.nextDepartureTime(stopIndex, adjustedTime); // min transfer time included in search