class ConcurrencyDependencyGraph {

    private final ProjectBuildList projectBuilds;

    private final ProjectDependencyGraph projectDependencyGraph;

    private final Set<MavenProject> finishedProjects = new HashSet<>();

    public ConcurrencyDependencyGraph(ProjectBuildList projectBuilds, ProjectDependencyGraph projectDependencyGraph) {
        this.projectDependencyGraph = projectDependencyGraph;
        this.projectBuilds = projectBuilds;
    }

    public int getNumberOfBuilds() {
        return projectBuilds.size();
    }

    /**
     * Gets all the builds that have no reactor-dependencies
     *
     * @return A set of all the initial builds
     */
    public List<MavenProject> getRootSchedulableBuilds() {
        Set<MavenProject> result = new LinkedHashSet<>();
        for (ProjectSegment projectBuild : projectBuilds) {
            if (projectDependencyGraph
                    .getUpstreamProjects(projectBuild.getProject(), false)
                    .isEmpty()) {
                result.add(projectBuild.getProject());
            }
        }
        if (result.isEmpty() && projectBuilds.size() > 0) {
            // Must return at least one project
            result.add(projectBuilds.get(0).getProject());
        }
        return new ArrayList<>(result);
    }

    /**
     * Marks the provided project as finished. Returns a list of
     *
     * @param mavenProject The project
     * @return The list of builds that are eligible for starting now that the provided project is done
     */
    public List<MavenProject> markAsFinished(MavenProject mavenProject) {
        finishedProjects.add(mavenProject);
        return getSchedulableNewProcesses(mavenProject);
    }

    private List<MavenProject> getSchedulableNewProcesses(MavenProject finishedProject) {<FILL_FUNCTION_BODY>}

    /**
     * @return set of projects that have yet to be processed successfully by the build.
     */
    public Set<MavenProject> getUnfinishedProjects() {
        Set<MavenProject> unfinished = new HashSet<>(projectBuilds.getProjects());
        unfinished.removeAll(finishedProjects);
        return unfinished;
    }

    /**
     * @return set of projects that have been successfully processed by the build.
     */
    protected Set<MavenProject> getFinishedProjects() {
        return finishedProjects;
    }

    protected ProjectBuildList getProjectBuilds() {
        return projectBuilds;
    }

    /**
     * For the given {@link MavenProject} {@code p}, return all of {@code p}'s dependencies.
     *
     * @param p
     * @return List of prerequisite projects
     */
    protected List<MavenProject> getDependencies(MavenProject p) {
        return projectDependencyGraph.getUpstreamProjects(p, false);
    }

    /**
     * For the given {@link MavenProject} {@code p} return {@code p}'s uncompleted dependencies.
     *
     * @param p
     * @return List of uncompleted prerequisite projects
     */
    public List<MavenProject> getActiveDependencies(MavenProject p) {
        List<MavenProject> activeDependencies = projectDependencyGraph.getUpstreamProjects(p, false);
        activeDependencies.removeAll(finishedProjects);
        return activeDependencies;
    }
}

        List<MavenProject> result = new ArrayList<>();
        // schedule dependent projects, if all of their requirements are met
        for (MavenProject dependentProject : projectDependencyGraph.getDownstreamProjects(finishedProject, false)) {
            final List<MavenProject> upstreamProjects =
                    projectDependencyGraph.getUpstreamProjects(dependentProject, false);
            if (finishedProjects.containsAll(upstreamProjects)) {
                result.add(dependentProject);
            }
        }
        return result;
    
<no_super_class>