VehicleLocationRecordCacheImpl implements VehicleLocationRecordCache { public void setBlockLocationRecordCacheWindowSize(int windowSize) { _blockLocationRecordCacheWindowSize = windowSize; }  void setBlockLocationRecordCacheWindowSize(int windowSize); void setCacheEvictionFrequency(int cacheEvictionFrequency); @PostConstruct void start(); @PreDestroy void stop(); @Override void addRawPosition(AgencyAndId vehicleId, VehicleLocationRecord point); @Override VehicleLocationRecord getRawPosition(AgencyAndId vehicleId); @Override VehicleLocationCacheElements getRecordForVehicleId(
      AgencyAndId vehicleId); @Override List<VehicleLocationCacheElements> getRecordsForBlockInstance(
      BlockInstance blockInstance); @Override VehicleLocationCacheElements addRecord(BlockInstance blockInstance,
      VehicleLocationRecord record,
      ScheduledBlockLocation scheduledBlockLocation,
      ScheduleDeviationSamples samples); @Override void clearRecordsForVehicleId(AgencyAndId vehicleId); void clearStaleRecords(long time);  }
@Test public void testConcurrentOperations() { VehicleLocationRecordCacheImpl cache = new VehicleLocationRecordCacheImpl(); cache.setBlockLocationRecordCacheWindowSize(2); long serviceDate = System.currentTimeMillis(); int vid = 0; for (int i = 0; i < 20; i++) { BlockEntryImpl block = block(Integer.toString(i)); TripEntryImpl trip = trip(Integer.toString(i), "serviceId"); stopTime(0, null, trip, time(9, 00), 0); BlockConfigurationEntry blockConfig = linkBlockTrips(block, trip); BlockInstance blockInstance = new BlockInstance(blockConfig, serviceDate); for (int j = 0; j < 5; j++) { AgencyAndId vehicleId = new AgencyAndId("1", Integer.toString(vid++)); RecordSource source = new RecordSource(blockInstance, vehicleId, cache); Thread thread = new Thread(source); thread.run(); } } }