### Question:
CHAlgoFactoryDecorator implements RoutingAlgorithmFactoryDecorator { public void createPreparations(GraphHopperStorage ghStorage, TraversalMode traversalMode) { if (!isEnabled() || !preparations.isEmpty()) return; if (weightings.isEmpty()) throw new IllegalStateException("No CH weightings found"); traversalMode = getNodeBase(); for (Weighting weighting : getWeightings()) { PrepareContractionHierarchies tmpPrepareCH = new PrepareContractionHierarchies( new GHDirectory("", DAType.RAM_INT), ghStorage, ghStorage.getGraph(CHGraph.class, weighting), weighting, traversalMode); tmpPrepareCH.setPeriodicUpdates(preparationPeriodicUpdates). setLazyUpdates(preparationLazyUpdates). setNeighborUpdates(preparationNeighborUpdates). setLogMessages(preparationLogMessages); addPreparation(tmpPrepareCH); } } CHAlgoFactoryDecorator(); @Override void init(CmdArgs args); int getPreparationPeriodicUpdates(); CHAlgoFactoryDecorator setPreparationPeriodicUpdates(int preparePeriodicUpdates); int getPreparationContractedNodes(); CHAlgoFactoryDecorator setPreparationContractedNodes(int prepareContractedNodes); int getPreparationLazyUpdates(); CHAlgoFactoryDecorator setPreparationLazyUpdates(int prepareLazyUpdates); double getPreparationLogMessages(); CHAlgoFactoryDecorator setPreparationLogMessages(double prepareLogMessages); int getPreparationNeighborUpdates(); CHAlgoFactoryDecorator setPreparationNeighborUpdates(int prepareNeighborUpdates); @Override final boolean isEnabled(); final CHAlgoFactoryDecorator setEnabled(boolean enabled); final boolean isDisablingAllowed(); final CHAlgoFactoryDecorator setDisablingAllowed(boolean disablingAllowed); CHAlgoFactoryDecorator addWeighting(Weighting weighting); CHAlgoFactoryDecorator addWeighting(String weighting); CHAlgoFactoryDecorator addPreparation(PrepareContractionHierarchies pch); final boolean hasWeightings(); final List<Weighting> getWeightings(); CHAlgoFactoryDecorator setWeightingsAsStrings(String... weightingNames); List<String> getWeightingsAsStrings(); CHAlgoFactoryDecorator setWeightingsAsStrings(List<String> weightingList); List<PrepareContractionHierarchies> getPreparations(); @Override RoutingAlgorithmFactory getDecoratedAlgorithmFactory(RoutingAlgorithmFactory defaultAlgoFactory, HintsMap map); int getPreparationThreads(); void setPreparationThreads(int preparationThreads); void prepare(final StorableProperties properties); void createPreparations(GraphHopperStorage ghStorage, TraversalMode traversalMode); TraversalMode getNodeBase();  }### Answer:
@Test public void testCreatePreparations() { CHAlgoFactoryDecorator instance = new CHAlgoFactoryDecorator(); assertFalse(instance.isDisablingAllowed()); instance.setEnabled(false); assertTrue(instance.isDisablingAllowed()); }