private static void collectChildrenProjects(
     @NotNull final MavenDomProjectModel model, @NotNull Set<MavenDomProjectModel> models) {
   MavenProject mavenProject = MavenDomUtil.findProject(model);
   if (mavenProject != null) {
     final Project project = model.getManager().getProject();
     for (MavenProject inheritor :
         MavenProjectsManager.getInstance(project).findInheritors(mavenProject)) {
       MavenDomProjectModel inheritorProjectModel =
           MavenDomUtil.getMavenDomProjectModel(project, inheritor.getFile());
       if (inheritorProjectModel != null && !models.contains(inheritorProjectModel)) {
         models.add(inheritorProjectModel);
         collectChildrenProjects(inheritorProjectModel, models);
       }
     }
   }
 }
  public static <T> boolean process(
      @NotNull MavenDomProjectModel projectDom,
      @NotNull final Processor<T> processor,
      @NotNull final Project project,
      @NotNull final Function<? super MavenDomProfile, T> domProfileFunction,
      @NotNull final Function<? super MavenDomProjectModel, T> projectDomFunction,
      final Set<MavenDomProjectModel> processed) {
    if (processed.contains(projectDom)) return true;
    processed.add(projectDom);

    MavenProject mavenProjectOrNull = MavenDomUtil.findProject(projectDom);

    if (processSettingsXml(mavenProjectOrNull, processor, project, domProfileFunction)) return true;
    if (processProject(
        projectDom, mavenProjectOrNull, processor, project, domProfileFunction, projectDomFunction))
      return true;

    return processParentProjectFile(
        projectDom, processor, project, domProfileFunction, projectDomFunction, processed);
  }
  public static void processChildrenRecursively(
      @Nullable MavenDomProjectModel model,
      @NotNull Processor<MavenDomProjectModel> processor,
      @NotNull Project project,
      @NotNull Set<MavenDomProjectModel> processedModels,
      boolean strict) {
    if (model != null && !processedModels.contains(model)) {
      processedModels.add(model);

      if (strict && processor.process(model)) return;

      MavenProject mavenProject = MavenDomUtil.findProject(model);
      if (mavenProject != null) {
        for (MavenProject childProject :
            MavenProjectsManager.getInstance(project).findInheritors(mavenProject)) {
          MavenDomProjectModel childProjectModel =
              MavenDomUtil.getMavenDomProjectModel(project, childProject.getFile());

          processChildrenRecursively(childProjectModel, processor, project, processedModels, true);
        }
      }
    }
  }