cache.setBlockLocationRecordCacheWindowSize(20);
List<VehicleLocationCacheElements> records = cache.getRecordsForBlockInstance(blockInstance);
assertEquals(0, records.size());
VehicleLocationCacheElements cacheRecord = cache.getRecordForVehicleId(aid("vehicleA"));
assertNull(cacheRecord);
cache.addRecord(blockInstance,
record(20, "blockA", serviceDate, "vehicleA", 10.0), null, null);
records = cache.getRecordsForBlockInstance(blockInstance);
assertEquals(1, records.size());
cacheRecord = records.get(0);
VehicleLocationRecord record = cacheRecord.getLastElement().getRecord();
assertEquals(20, record.getTimeOfRecord());
assertEquals(blockInstance, cacheRecord.getBlockInstance());
assertEquals(aid("vehicleA"), record.getVehicleId());
VehicleLocationCacheElements cacheRecord2 = cache.getRecordForVehicleId(aid("vehicleA"));
assertSame(cacheRecord, cacheRecord2);
cache.addRecord(blockInstance,
record(30, "blockA", serviceDate, "vehicleA", 20.0), null, null);