class CHAlgoFactoryDecorator implements RoutingAlgorithmFactoryDecorator {

    public CHAlgoFactoryDecorator addPreparation(PrepareContractionHierarchies pch) {
        // we want to make sure that CH preparations are added in the same order as their corresponding profiles
        if (preparations.size() >= chProfiles.size()) {
            throw new IllegalStateException("You need to add the corresponding CH profiles before adding preparations.");
        }
        CHProfile expectedProfile = chProfiles.get(preparations.size());
        if (!pch.getCHProfile().equals(expectedProfile)) {
            throw new IllegalArgumentException("CH profile of preparation: " + pch + " needs to be identical to previously added CH profile: " + expectedProfile);
        }
        preparations.add(pch);
        return this;
    }

    public  CHAlgoFactoryDecorator();

}