assertEquals(6, allIndices.size());
List<BlockStopTimeIndex> indices = grep(allIndices, aid("a"),
serviceIds(lsids("s1"), lsids()));
assertEquals(1, indices.size());
BlockStopTimeIndex index = indices.get(0);
assertEquals(15, index.getStopTimes().size());
assertEquals(bcA.getStopTimes().get(0), index.getStopTimes().get(0));
assertEquals(bcB.getStopTimes().get(0), index.getStopTimes().get(1));
assertEquals(bcA.getStopTimes().get(3), index.getStopTimes().get(2));
assertEquals(bcF.getStopTimes().get(0), index.getStopTimes().get(3));
assertEquals(bcC.getStopTimes().get(0), index.getStopTimes().get(4));
assertEquals(bcA.getStopTimes().get(4), index.getStopTimes().get(5));
assertEquals(bcE.getStopTimes().get(0), index.getStopTimes().get(6));
assertEquals(bcB.getStopTimes().get(3), index.getStopTimes().get(7));
assertEquals(bcC.getStopTimes().get(3), index.getStopTimes().get(8));
assertEquals(bcB.getStopTimes().get(4), index.getStopTimes().get(9));
assertEquals(bcC.getStopTimes().get(4), index.getStopTimes().get(10));
assertEquals(bcF.getStopTimes().get(3), index.getStopTimes().get(11));
assertEquals(bcF.getStopTimes().get(4), index.getStopTimes().get(12));
assertEquals(bcE.getStopTimes().get(3), index.getStopTimes().get(13));
assertEquals(bcE.getStopTimes().get(4), index.getStopTimes().get(14));
indices = grep(allIndices, aid("a"), serviceIds(lsids("s1", "s2"), lsids()));
assertEquals(1, indices.size());
index = indices.get(0);
assertEquals(3, index.getStopTimes().size());
assertEquals(bcD.getStopTimes().get(0), index.getStopTimes().get(0));
assertEquals(bcD.getStopTimes().get(3), index.getStopTimes().get(1));
assertEquals(bcD.getStopTimes().get(4), index.getStopTimes().get(2));
indices = grep(allIndices, aid("b"), serviceIds(lsids("s1"), lsids()));
assertEquals(1, indices.size());
index = indices.get(0);
assertEquals(8, index.getStopTimes().size());
assertEquals(bcA.getStopTimes().get(1), index.getStopTimes().get(0));
assertEquals(bcB.getStopTimes().get(1), index.getStopTimes().get(1));
assertEquals(bcC.getStopTimes().get(1), index.getStopTimes().get(2));
assertEquals(bcA.getStopTimes().get(5), index.getStopTimes().get(3));
assertEquals(bcF.getStopTimes().get(1), index.getStopTimes().get(4));
assertEquals(bcE.getStopTimes().get(1), index.getStopTimes().get(5));
assertEquals(bcC.getStopTimes().get(5), index.getStopTimes().get(6));
assertEquals(bcB.getStopTimes().get(5), index.getStopTimes().get(7));
indices = grep(allIndices, aid("b"), serviceIds(lsids("s1", "s2"), lsids()));
assertEquals(1, indices.size());
index = indices.get(0);
assertEquals(2, index.getStopTimes().size());
assertEquals(bcD.getStopTimes().get(1), index.getStopTimes().get(0));
assertEquals(bcD.getStopTimes().get(5), index.getStopTimes().get(1));
indices = grep(allIndices, aid("c"), serviceIds(lsids("s1"), lsids()));
assertEquals(1, indices.size());
index = indices.get(0);
assertEquals(5, index.getStopTimes().size());
assertEquals(bcA.getStopTimes().get(2), index.getStopTimes().get(0));
assertEquals(bcB.getStopTimes().get(2), index.getStopTimes().get(1));
assertEquals(bcC.getStopTimes().get(2), index.getStopTimes().get(2));
assertEquals(bcF.getStopTimes().get(2), index.getStopTimes().get(3));
assertEquals(bcE.getStopTimes().get(2), index.getStopTimes().get(4));
indices = grep(allIndices, aid("c"), serviceIds(lsids("s1", "s2"), lsids()));
assertEquals(1, indices.size());
index = indices.get(0);
assertEquals(1, index.getStopTimes().size());
assertEquals(bcD.getStopTimes().get(2), index.getStopTimes().get(0));
}