BlockStopTimeIndicesFactory { public List<FrequencyBlockStopTimeIndex> createFrequencyIndices( Iterable<BlockEntry> blocks) { Map<BlockStopTimeKey, List<BlockStopTimeEntry>> stopTimesByKey = groupBlockStopTimes( blocks, true); return createFrequencyIndicesFromGroups(stopTimesByKey); }  void setVerbose(boolean verbose); List<BlockStopTimeIndex> createIndices(Iterable<BlockEntry> blocks); List<FrequencyBlockStopTimeIndex> createFrequencyIndices(
      Iterable<BlockEntry> blocks);  }
@Test public void testFrequencies() { StopEntryImpl stopA = stop("a", 47.0, -122.0); StopEntryImpl stopB = stop("b", 47.1, -122.1); BlockEntryImpl blockA = block("a"); TripEntryImpl tripA = trip("a", "s1"); stopTime(0, stopA, tripA, 0, 10, 0); stopTime(0, stopB, tripA, 20, 20, 0); FrequencyEntry freqA1 = frequency(time(6, 00), time(9, 00), 10, 0); FrequencyEntry freqA2 = frequency(time(15, 00), time(18, 00), 10, 0); List<FrequencyEntry> freqsA = Arrays.asList(freqA1, freqA2); BlockConfigurationEntry bcA = linkBlockTrips(blockA, freqsA, tripA); BlockEntryImpl blockB = block("b"); TripEntryImpl tripB = trip("b", "s1"); stopTime(0, stopA, tripB, 20, 30, 0); stopTime(0, stopB, tripB, 50, 50, 0); FrequencyEntry freqB1 = frequency(time(9, 00), time(15, 00), 20, 0); FrequencyEntry freqB2 = frequency(time(18, 00), time(21, 00), 20, 0); List<FrequencyEntry> freqsB = Arrays.asList(freqB1, freqB2); BlockConfigurationEntry bcB = linkBlockTrips(blockB, freqsB, tripB); BlockStopTimeIndicesFactory factory = new BlockStopTimeIndicesFactory(); List<FrequencyBlockStopTimeIndex> allIndices = factory.createFrequencyIndices(Arrays.asList( (BlockEntry) blockB, blockA)); assertEquals(2, allIndices.size()); List<FrequencyBlockStopTimeIndex> indices = grep(allIndices, aid("a"), serviceIds(lsids("s1"), lsids())); assertEquals(1, indices.size()); FrequencyBlockStopTimeIndex index = indices.get(0); assertEquals(freqA1, index.getFrequencies().get(0)); assertEquals(freqB1, index.getFrequencies().get(1)); assertEquals(freqA2, index.getFrequencies().get(2)); assertEquals(freqB2, index.getFrequencies().get(3)); assertEquals(bcA, index.getBlockConfigs().get(0)); assertEquals(bcB, index.getBlockConfigs().get(1)); assertEquals(bcA, index.getBlockConfigs().get(2)); assertEquals(bcB, index.getBlockConfigs().get(3)); }