@NotNull
  private static List<LocalArchivedTemplate.RootDescription> collectStructure(Project project, Module moduleToSave) {
    List<LocalArchivedTemplate.RootDescription> result = new ArrayList<>();
    if (moduleToSave != null) {
      PathMacroManager macroManager = PathMacroManager.getInstance(moduleToSave);
      ModuleRootManager rootManager = ModuleRootManager.getInstance(moduleToSave);
      int i = 0;
      for (VirtualFile file : rootManager.getContentRoots()) {
        result.add(i, describeRoot(file, i, macroManager));
        i++;
      }
    }
    else {
      PathMacroManager macroManager = PathMacroManager.getInstance(project);
      ProjectRootManager rootManager = ProjectRootManager.getInstance(project);
      int i = 0;
      for (VirtualFile file : rootManager.getContentRoots()) {
        result.add(i, describeRoot(file, i, macroManager));
        i++;
      }
    }
    return result;
  }
@NotNull
  private static List<LocalArchivedTemplate.RootDescription> collectStructure(Project project, Module moduleToSave)