LastStopToHeadsignStrategy implements GtfsTransformStrategy { @Override public void run(TransformContext context, GtfsMutableRelationalDao dao) { for (Trip trip: dao.getAllTrips()){ List<StopTime> stopTimes = dao.getStopTimesForTrip(trip); Stop lastStop = stopTimes.get(stopTimes.size() - 1).getStop(); trip.setTripHeadsign(lastStop.getName()); } }  @Override String getName(); @Override void run(TransformContext context, GtfsMutableRelationalDao dao);  }
@Test public void test() { LastStopToHeadsignStrategy _strategy = new LastStopToHeadsignStrategy(); AgencyAndId tripId = new AgencyAndId(); tripId.setId("1.1"); tripId.setAgencyId("agency"); Trip trip = _dao.getTripForId(tripId); Assert.assertNotSame("C",trip.getTripHeadsign()); _strategy.run(new TransformContext(), _dao); trip = _dao.getTripForId(tripId); Assert.assertEquals("C",trip.getTripHeadsign()); }