class DependencyContext {

    private final MavenProject project;

    private final Collection<String> scopesToCollectForCurrentProject;

    private final Collection<String> scopesToResolveForCurrentProject;

    private final Collection<String> scopesToCollectForAggregatedProjects;

    private final Collection<String> scopesToResolveForAggregatedProjects;

    private volatile Collection<?> lastDependencyArtifacts = Collections.emptyList();

    private volatile int lastDependencyArtifactCount = -1;

    public DependencyContext(
            MavenProject project, Collection<String> scopesToCollect, Collection<String> scopesToResolve) {
        this.project = project;
        scopesToCollectForCurrentProject = scopesToCollect;
        scopesToResolveForCurrentProject = scopesToResolve;
        scopesToCollectForAggregatedProjects = Collections.synchronizedSet(new TreeSet<>());
        scopesToResolveForAggregatedProjects = Collections.synchronizedSet(new TreeSet<>());
    }

    public MavenProject getProject() {
        return project;
    }

    public Collection<String> getScopesToCollectForCurrentProject() {
        return scopesToCollectForCurrentProject;
    }

    public Collection<String> getScopesToResolveForCurrentProject() {
        return scopesToResolveForCurrentProject;
    }

    public Collection<String> getScopesToCollectForAggregatedProjects() {
        return scopesToCollectForAggregatedProjects;
    }

    public Collection<String> getScopesToResolveForAggregatedProjects() {
        return scopesToResolveForAggregatedProjects;
    }

    public boolean isResolutionRequiredForCurrentProject() {<FILL_FUNCTION_BODY>}

    public boolean isResolutionRequiredForAggregatedProjects(
            Collection<String> scopesToCollect, Collection<String> scopesToResolve) {
        return scopesToCollectForAggregatedProjects.addAll(scopesToCollect)
                || scopesToResolveForAggregatedProjects.addAll(scopesToResolve);
    }

    public void synchronizeWithProjectState() {
        lastDependencyArtifacts = project.getDependencyArtifacts();
        lastDependencyArtifactCount = (lastDependencyArtifacts != null) ? lastDependencyArtifacts.size() : 0;
    }
}

        return lastDependencyArtifacts != project.getDependencyArtifacts()
                || (lastDependencyArtifacts != null && lastDependencyArtifactCount != lastDependencyArtifacts.size());
    
<no_super_class>