GtfsRealtimeEntitySource { public TripEntry getTrip(String tripId) { for (String agencyId : _agencyIds) { AgencyAndId id = new AgencyAndId(agencyId, tripId); TripEntry trip = _transitGraphDao.getTripEntryForId(id); if (trip != null) return trip; } try { AgencyAndId id = AgencyAndId.convertFromString(tripId); TripEntry trip = _transitGraphDao.getTripEntryForId(id); if (trip != null) return trip; } catch (IllegalArgumentException ex) { } return null; }  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 testGetTrip() { TripEntryImpl trip = new TripEntryImpl(); trip.setId(new AgencyAndId("2", "T10")); Mockito.when(_dao.getTripEntryForId(trip.getId())).thenReturn(trip); TripEntry trip2 = _source.getTrip("T10"); assertSame(trip, trip2); trip2 = _source.getTrip("T11"); assertNull(trip2); }