SiriLikeRealtimeSource { public Date parseDate(String s) throws Exception { int endPos = "yyyy-MM-ddTHH:mm:ss.SSS".length(); s = s.substring(0, endPos-1) + s.substring((s.length() - 7), s.length()); return ISO_DATE_FORMAT.parse(s); }  void setApiKey(String key); String getApiKey(); void setBaseUrl(String url); String getUrl(); void setAgency(String agencyId); void setRefreshInterval(int refreshInterval); @Autowired void setTransitGraphDao(TransitGraphDaoImpl transitGraphDao); @Autowired void setBlockGeospatialService(BlockGeospatialService blockGeospatialService); @Autowired void setVehicleLocationListener(
      VehicleLocationListener vehicleLocationListener); @Autowired void setScheduledExecutorService(
      ScheduledExecutorService scheduledExecutorService); @PostConstruct void setup(); @PreDestroy void stop(); void setRoutes(List<String> routes); List<String> getRoutes(); void refresh(); NodesAndTimestamp parseVehicles(URL url); VehicleLocationRecord parse(Node node, long timestamp); Date parseShortDate(String s); Date parseDate(String s); Date parseServiceDate(String serviceDateStr); public List<String> _routeList; }
@Test public void testParseDate() throws Exception { String s = "2016-08-03T06:39:48-06:00"; Date d = source.parseShortDate(s); assertEquals("expected time of " + new Date(1470227988000l) +", got " + d, 1470227988000l, d.getTime()); s = "2016-08-03T08:54:36.2551919-06:00"; d = source.parseDate(s); assertEquals("expected " + new Date(1470236076259l) + ", got " + d, 1470236076259l, d.getTime()); s = "2016-08-03T12:13:26.4430-06:00"; d = source.parseDate(s); assertEquals("expected " + new Date(1470248006440l) + ", got " + d, 1470248006440l, d.getTime()); }