class StackManager {

  public Map<String, List<StackInfo>> getStacksByName() {
    Map<String, List<StackInfo>> stacks = new HashMap<>();
    for (StackInfo stack: stackMap.values()) {
      List<StackInfo> list = stacks.get(stack.getName());
      if (list == null) {
        list = new ArrayList<>();
        stacks.put(stack.getName(),  list);
      }
      list.add(stack);
    }
    return stacks;
  }

  @AssistedInject public  StackManager(@Assisted("stackRoot") File stackRoot,
      @Assisted("commonServicesRoot") @Nullable File commonServicesRoot,
      @Assisted("extensionRoot") @Nullable File extensionRoot,
      @Assisted OsFamily osFamily, @Assisted boolean validate,
      MetainfoDAO metaInfoDAO, ActionMetadata actionMetadata, StackDAO stackDao,
      ExtensionDAO extensionDao, ExtensionLinkDAO linkDao, AmbariManagementHelper helper);

}