Collections.sort(closestStops);
double minTime = 0;
TripToStop minStop = null;
TransitLocationBean place = new TransitLocationBean();
place.setLat(result.getLat());
place.setLon(result.getLon());
for (TripToStop o : closestStops) {
long currentTripDuration = o.getTransitTimeToStop();
double minTimeToPlace = o.getMinTansitTimeToPlace();
// Short circuit if there is no way any of the remaining trips is going
// to be better than our current winner
if (minStop != null && minTimeToPlace > minTime)
break;
int remainingTime = (int) ((maxTripLength - currentTripDuration) / 1000);
walkConstraints.setMaxTripDuration(remainingTime);
int index = o.getIndex();
TransitLocationBean stopLocation = new TransitLocationBean();
stopLocation.setLat(travelTimes.getStopLat(index));
stopLocation.setLon(travelTimes.getStopLon(index));
ItinerariesBean itineraries = getItinerariesBetween(stopLocation,
place, System.currentTimeMillis(), walkConstraints);
for (ItineraryBean plan : itineraries.getItineraries()) {