private IReadOnlyList <ProjectData> GetProjects(
            IEnumerable <Process> allProcesses,
            Dictionary <PipId, AbsolutePath> sealedDirectoriesFromWrappers)
        {
            return(Measure(
                       "Constructing Project Data",
                       () =>
            {
                var groups = allProcesses.GroupBy(p => p.Provenance.Token.Path).ToArray();
                var projects = new ProjectData[groups.Length];
                Parallel.For(
                    0,
                    groups.Length,
                    i =>
                {
                    var specFileGroupedProcesses = groups[i];
                    var projectFolder = specFileGroupedProcesses.Key.GetParent(PathTable);
                    var project = new ProjectData(projectFolder);

                    foreach (var process in specFileGroupedProcesses)
                    {
                        foreach (var dependency in PipGraph.RetrievePipReferenceImmediateDependencies(process.PipId, PipType.Process))
                        {
                            project.AddProjectDependency(GetProjectFolder(dependency.HydratePip()));
                        }

                        foreach (var dependency in PipGraph.RetrievePipReferenceImmediateDependencies(process.PipId, PipType.SealDirectory))
                        {
                            AbsolutePath projectDependency;
                            if (sealedDirectoriesFromWrappers.TryGetValue(dependency.PipId, out projectDependency))
                            {
                                project.AddProjectDependency(projectDependency);
                            }
                            else
                            {
                                project.AddSourceFolderDependency(GetProjectFolder(dependency.HydratePip()));
                            }
                        }
                    }

                    projects[i] = project;
                });

                return projects;
            }));
        }