GtfsRealtimeEntitySource { public Id getRouteId(String routeId) { for (String agencyId : _agencyIds) { AgencyAndId id = new AgencyAndId(agencyId, routeId); RouteEntry route = _transitGraphDao.getRouteForId(id); if (route != null) return ServiceAlertLibrary.id(route.getParent().getId()); } try { AgencyAndId id = AgencyAndId.convertFromString(routeId); RouteEntry route = _transitGraphDao.getRouteForId(id); if (route != null) return ServiceAlertLibrary.id(route.getParent().getId()); } catch (IllegalArgumentException ex) { } AgencyAndId id = new AgencyAndId(_agencyIds.get(0), routeId); _log.warn("route not found with id \"{}\", defaulting to {}", routeId, id); return ServiceAlertLibrary.id(id); }  void setTransitGraphDao(TransitGraphDao transitGraphDao); void setConsolidatedStopService(ConsolidatedStopsService service); void setAgencyIds(List<String> agencyIds); Id getRouteId(String routeId); Id getTripId(String tripId); TripEntry getTrip(String tripId); Id getStopId(String stopId);  }
@Test public void testGetRouteId() { RouteCollectionEntryImpl routeCollection = new RouteCollectionEntryImpl(); routeCollection.setId(new AgencyAndId("2", "R10C")); RouteEntryImpl route = new RouteEntryImpl(); route.setId(new AgencyAndId("2", "R10")); route.setParent(routeCollection); Mockito.when(_dao.getRouteForId(route.getId())).thenReturn(route); Id routeId = _source.getRouteId("R10"); assertEquals("2", routeId.getAgencyId()); assertEquals("R10C", routeId.getId()); routeId = _source.getRouteId("R11"); assertEquals("1", routeId.getAgencyId()); assertEquals("R11", routeId.getId()); }