@Override
 protected void writeStopSequence() throws IOException {
   log.println("Writing stop sequence: " + tripId());
   time = new TimeString(0);
   preStop = null;
   sequence = 1;
   String key = routeId() + "_" + directionId();
   Stack<Stop> stopSequence = fetchStopSequence(key);
   int i = 0;
   if (from != null) {
     while (i < stopSequence.size() && !Stop.overlap(stopSequence.get(i).getAddress(), from)) {
       i++;
     }
   }
   if (to == null) {
     for (; i < stopSequence.size(); i++) {
       boolean bypass = false;
       for (String stop : this.bypass) {
         if (Stop.overlap(stopSequence.get(i).getAddress(), stop)) {
           bypass = true;
           break;
         }
       }
       if (!bypass) {
         writeStopIntoSequence(stopSequence.get(i));
       }
     }
   } else {
     for (; i < stopSequence.size(); i++) {
       boolean bypass = false;
       for (String stop : this.bypass) {
         if (Stop.overlap(stopSequence.get(i).getAddress(), stop)) {
           bypass = true;
           break;
         }
       }
       if (!bypass) {
         writeStopIntoSequence(stopSequence.get(i));
       }
       if (Stop.overlap(stopSequence.get(i).getAddress(), to)) {
         break;
       }
     }
   }
 }