GtfsRelationalDaoImpl extends GtfsDaoImpl implements
    GtfsMutableRelationalDao { @Override public List<Stop> getStopsForStation(Stop station) { if (_stopsByStation == null) { _stopsByStation = new HashMap<Stop, List<Stop>>(); for (Stop stop : getAllStops()) { if (stop.getLocationType() == 0 && stop.getParentStation() != null) { Stop parentStation = getStopForId(new AgencyAndId( stop.getId().getAgencyId(), stop.getParentStation())); List<Stop> subStops = _stopsByStation.get(parentStation); if (subStops == null) { subStops = new ArrayList<Stop>(2); _stopsByStation.put(parentStation, subStops); } subStops.add(stop); } } } return list(_stopsByStation.get(station)); }  void clearAllCaches(); @Override List<String> getTripAgencyIdsReferencingServiceId(AgencyAndId serviceId); @Override List<Route> getRoutesForAgency(Agency agency); @Override List<Stop> getStopsForStation(Stop station); @Override List<AgencyAndId> getAllShapeIds(); @Override List<ShapePoint> getShapePointsForShapeId(AgencyAndId shapeId); @Override List<StopTime> getStopTimesForTrip(Trip trip); @Override List<StopTime> getStopTimesForStop(Stop stop); @Override List<Trip> getTripsForRoute(Route route); @Override List<Trip> getTripsForShapeId(AgencyAndId shapeId); @Override List<Trip> getTripsForServiceId(AgencyAndId serviceId); @Override List<Trip> getTripsForBlockId(AgencyAndId blockId); @Override List<Frequency> getFrequenciesForTrip(Trip trip); @Override List<AgencyAndId> getAllServiceIds(); @Override List<ServiceCalendarDate> getCalendarDatesForServiceId(
      AgencyAndId serviceId); @Override ServiceCalendar getCalendarForServiceId(AgencyAndId serviceId); @Override List<FareRule> getFareRulesForFareAttribute(FareAttribute fareAttribute); @Override List<Ridership> getRidershipForTrip(AgencyAndId tripId);  }
@Test public void testStationSubStops() { GtfsRelationalDaoImpl dao = new GtfsRelationalDaoImpl(); Stop st = new Stop(); st.setLocationType(1); st.setId(new AgencyAndId("X", "ST")); dao.saveEntity(st); Stop st1 = new Stop(); st1.setLocationType(0); st1.setId(new AgencyAndId("X", "ST1")); st1.setParentStation("ST"); dao.saveEntity(st1); Stop st2 = new Stop(); st2.setLocationType(0); st2.setId(new AgencyAndId("X", "ST2")); st2.setParentStation("ST"); dao.saveEntity(st2); Stop st3 = new Stop(); st3.setLocationType(0); st3.setId(new AgencyAndId("X", "ST3")); dao.saveEntity(st3); List<Stop> sts = dao.getStopsForStation(st); assertTrue(sts.contains(st1)); assertTrue(sts.contains(st2)); assertTrue(!sts.contains(st3)); assertEquals(sts.size(), 2); }