private void initDependencyMaps(EmbeddableCartridgeRelations... dependencies) {
    this.dependenciesByCartridge =
        new HashMap<IEmbeddableCartridge, EmbeddableCartridgeRelations>();

    this.dependantsByCartridge = new HashMap<IEmbeddableCartridge, Set<IEmbeddableCartridge>>();
    for (EmbeddableCartridgeRelations dependency : dependencies) {
      dependenciesByCartridge.put(dependency.getSubject(), dependency);
      Set<IEmbeddableCartridge> dependants = getDependants(dependency);
      dependants.add(dependency.getSubject());
    }
  }
 protected void createDependants(
     Collection<IEmbeddableCartridge> allEmbeddableCartridges,
     EmbeddableCartridgeRelations dependency) {
   Set<IEmbeddableCartridge> dependants =
       dependantsByCartridge.get(dependency.getRequired(allEmbeddableCartridges));
   if (dependants == null) {
     IEmbeddableCartridge dependantCartridge = dependency.getRequired(allEmbeddableCartridges);
     if (dependantCartridge != null) {
       dependantsByCartridge.put(
           dependantCartridge, dependants = new HashSet<IEmbeddableCartridge>());
     }
   }
   if (dependants != null) {
     dependants.add(dependency.getSubject(allEmbeddableCartridges));
   }
 }
 protected void createDependency(
     Collection<IEmbeddableCartridge> allEmbeddableCartridges,
     EmbeddableCartridgeRelations dependency) {
   IEmbeddableCartridge requiringCartridge = dependency.getSubject(allEmbeddableCartridges);
   dependenciesByCartridge.put(requiringCartridge, dependency);
 }