### Question:
PrepareContractionHierarchies extends AbstractAlgoPreparation implements RoutingAlgorithmFactory { @Override public void doWork() { if (prepareWeighting == null) throw new IllegalStateException("No weight calculation set."); allSW.start(); super.doWork(); initFromGraph(); if (!prepareNodes()) return; contractNodes(); } PrepareContractionHierarchies(Directory dir, GraphHopperStorage ghStorage, CHGraph chGraph,
                                         Weighting weighting, TraversalMode traversalMode); PrepareContractionHierarchies setPeriodicUpdates(int periodicUpdates); PrepareContractionHierarchies setLazyUpdates(int lazyUpdates); PrepareContractionHierarchies setNeighborUpdates(int neighborUpdates); PrepareContractionHierarchies setLogMessages(double logMessages); PrepareContractionHierarchies setContractedNodes(double nodesContracted); @Override void doWork(); long getDijkstraCount(); double getLazyTime(); double getPeriodTime(); double getDijkstraTime(); double getNeighborTime(); Weighting getWeighting(); void close(); int getShortcuts(); @Override RoutingAlgorithm createAlgo(Graph graph, AlgorithmOptions opts); @Override String toString();  }### Answer:
@Test public void testMoreComplexGraph() { GraphHopperStorage g = createGHStorage(); CHGraph lg = g.getGraph(CHGraph.class); initShortcutsGraph(lg); int oldCount = g.getAllEdges().getMaxId(); PrepareContractionHierarchies prepare = new PrepareContractionHierarchies(dir, g, lg, weighting, tMode); prepare.doWork(); assertEquals(oldCount, g.getAllEdges().getMaxId()); assertEquals(oldCount + 7, lg.getAllEdges().getMaxId()); }