/****
* Configuration A & B
****/
BlockConfigurationEntry entry = configurations.get(0);
assertSame(block, entry.getBlock());
assertEquals(serviceIds(lsids("sA", "sB"), lsids()), entry.getServiceIds());
assertEquals(1200.0, entry.getTotalBlockDistance(), 0.0);
assertNull(entry.getFrequencies());
List<BlockTripEntry> trips = entry.getTrips();
assertEquals(4, trips.size());
BlockTripEntry trip = trips.get(0);
assertEquals(0, trip.getAccumulatedStopTimeIndex());
assertEquals(0, trip.getAccumulatedSlackTime());
assertEquals(0.0, trip.getDistanceAlongBlock(), 0.0);
assertSame(tripA, trip.getTrip());
assertNull(trip.getPreviousTrip());
assertSame(trips.get(1), trip.getNextTrip());
trip = trips.get(1);
assertEquals(2, trip.getAccumulatedStopTimeIndex());
assertEquals(10 * 60, trip.getAccumulatedSlackTime());
assertEquals(300.0, trip.getDistanceAlongBlock(), 0.0);
assertSame(tripB, trip.getTrip());
assertSame(trips.get(0), trip.getPreviousTrip());
assertSame(trips.get(2), trip.getNextTrip());
trip = trips.get(2);
assertEquals(4, trip.getAccumulatedStopTimeIndex());
assertEquals(20 * 60, trip.getAccumulatedSlackTime());
assertEquals(600.0, trip.getDistanceAlongBlock(), 0.0);
assertSame(tripC, trip.getTrip());
assertSame(trips.get(1), trip.getPreviousTrip());
assertSame(trips.get(3), trip.getNextTrip());
trip = trips.get(3);
assertEquals(6, trip.getAccumulatedStopTimeIndex());
assertEquals(30 * 60, trip.getAccumulatedSlackTime());
assertEquals(900.0, trip.getDistanceAlongBlock(), 0.0);
assertSame(tripD, trip.getTrip());
assertSame(trips.get(2), trip.getPreviousTrip());
assertNull(trip.getNextTrip());
List<BlockStopTimeEntry> stopTimes = entry.getStopTimes();
assertEquals(8, stopTimes.size());
BlockStopTimeEntry bst = stopTimes.get(0);
assertEquals(0, bst.getAccumulatedSlackTime());
assertEquals(0, bst.getBlockSequence());
assertEquals(100.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st0, bst.getStopTime());
assertSame(trips.get(0), bst.getTrip());
bst = stopTimes.get(1);
assertEquals(5 * 60, bst.getAccumulatedSlackTime());
assertEquals(1, bst.getBlockSequence());
assertEquals(200.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st1, bst.getStopTime());
assertSame(trips.get(0), bst.getTrip());
bst = stopTimes.get(2);
assertEquals(10 * 60, bst.getAccumulatedSlackTime());
assertEquals(2, bst.getBlockSequence());
assertEquals(400.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st2, bst.getStopTime());
assertSame(trips.get(1), bst.getTrip());
bst = stopTimes.get(3);
assertEquals(15 * 60, bst.getAccumulatedSlackTime());
assertEquals(3, bst.getBlockSequence());
assertEquals(500.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st3, bst.getStopTime());
assertSame(trips.get(1), bst.getTrip());
bst = stopTimes.get(4);
assertEquals(20 * 60, bst.getAccumulatedSlackTime());
assertEquals(4, bst.getBlockSequence());
assertEquals(700.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st4, bst.getStopTime());
assertSame(trips.get(2), bst.getTrip());
bst = stopTimes.get(5);
assertEquals(25 * 60, bst.getAccumulatedSlackTime());
assertEquals(5, bst.getBlockSequence());
assertEquals(800.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st5, bst.getStopTime());
assertSame(trips.get(2), bst.getTrip());
bst = stopTimes.get(6);
assertEquals(30 * 60, bst.getAccumulatedSlackTime());
assertEquals(6, bst.getBlockSequence());
assertEquals(1000.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st6, bst.getStopTime());
assertSame(trips.get(3), bst.getTrip());
bst = stopTimes.get(7);
assertEquals(35 * 60, bst.getAccumulatedSlackTime());
assertEquals(7, bst.getBlockSequence());
assertEquals(1100.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st7, bst.getStopTime());
assertSame(trips.get(3), bst.getTrip());
/****
* Configuration A
****/
entry = configurations.get(1);
assertSame(block, entry.getBlock());
assertEquals(serviceIds(lsids("sA"), lsids("sB")), entry.getServiceIds());
assertEquals(600.0, entry.getTotalBlockDistance(), 0.0);
assertNull(entry.getFrequencies());
trips = entry.getTrips();
assertEquals(2, trips.size());
trip = trips.get(0);
assertEquals(0, trip.getAccumulatedStopTimeIndex());
assertEquals(0, trip.getAccumulatedSlackTime());
assertEquals(0.0, trip.getDistanceAlongBlock(), 0.0);
assertSame(tripA, trip.getTrip());
assertNull(trip.getPreviousTrip());
assertSame(trips.get(1), trip.getNextTrip());
trip = trips.get(1);
assertEquals(2, trip.getAccumulatedStopTimeIndex());
assertEquals(10 * 60, trip.getAccumulatedSlackTime());
assertEquals(300.0, trip.getDistanceAlongBlock(), 0.0);
assertSame(tripB, trip.getTrip());
assertSame(trips.get(0), trip.getPreviousTrip());
assertNull(trip.getNextTrip());
stopTimes = entry.getStopTimes();
assertEquals(4, stopTimes.size());
bst = stopTimes.get(0);
assertEquals(0, bst.getAccumulatedSlackTime());
assertEquals(0, bst.getBlockSequence());
assertEquals(100.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st0, bst.getStopTime());
assertSame(trips.get(0), bst.getTrip());
bst = stopTimes.get(1);
assertEquals(5 * 60, bst.getAccumulatedSlackTime());
assertEquals(1, bst.getBlockSequence());
assertEquals(200.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st1, bst.getStopTime());
assertSame(trips.get(0), bst.getTrip());
bst = stopTimes.get(2);
assertEquals(10 * 60, bst.getAccumulatedSlackTime());
assertEquals(2, bst.getBlockSequence());
assertEquals(400.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st2, bst.getStopTime());
assertSame(trips.get(1), bst.getTrip());
bst = stopTimes.get(3);
assertEquals(15 * 60, bst.getAccumulatedSlackTime());
assertEquals(3, bst.getBlockSequence());
assertEquals(500.0, bst.getDistanceAlongBlock(), 0.0);
assertSame(st3, bst.getStopTime());
assertSame(trips.get(1), bst.getTrip());
/****
* Configuration B
****/
entry = configurations.get(2);
assertSame(block, entry.getBlock());
assertEquals(serviceIds(lsids("sB"), lsids("sA")), entry.getServiceIds());
assertEquals(600.0, entry.getTotalBlockDistance(), 0.0);
assertNull(entry.getFrequencies());
trips = entry.getTrips();
assertEquals(2, trips.size());
trip = trips.get(0);
assertEquals(0, trip.getAccumulatedStopTimeIndex());
assertEquals(0, trip.getAccumulatedSlackTime());
assertEquals(0.0, trip.getDistanceAlongBlock(), 0.0);
assertSame(tripC, trip.getTrip());
assertNull(trip.getPreviousTrip());
assertSame(trips.get(1), trip.getNextTrip());
trip = trips.get(1);
assertEquals(2, trip.getAccumulatedStopTimeIndex());
assertEquals(10 * 60, trip.getAccumulatedSlackTime());
assertEquals(300.0, trip.getDistanceAlongBlock(), 0.0);
assertSame(tripD, trip.getTrip());
assertSame(trips.get(0), trip.getPreviousTrip());
assertNull(trip.getNextTrip());
stopTimes = entry.getStopTimes();
assertEquals(4, stopTimes.size());
bst = stopTimes.get(0);
assertEquals(0, bst.getAccumulatedSlackTime());
assertEquals(0, bst.getBlockSequence());