class DependencyValidator implements PropertiesValidator {

    @Override
    public Collection<ValidationMessage> validate(@NotNull PackageProperties properties) {
        
        // use resolved dependencies
        Collection<ValidationMessage> messages = new LinkedList<>();
        
        Map<String, PackageInfo> roots = new HashMap<>();
        
        // check for unresolved dependencies!
        for (Dependency dependency : properties.getDependencies()) {
            boolean isDependencyResolved = false;
            for (PackageInfo resolvedDependency : dependenciesMetaInfo) {
                if (dependency.matches(resolvedDependency.getId())) {
                    for (PathFilterSet set : resolvedDependency.getFilter().getFilterSets()) {
                        String root = set.getRoot();
                        PackageInfo existing = roots.get(root);
                        if (existing != null) {
                            String msg = String.format(MESSAGE_DEPENDENCIES_WITH_OVERLAPPING_FILTERS,
                                    resolvedDependency.getId(), root, existing.getId());
                            messages.add(new ValidationMessage(severity, msg));
                        }
                        roots.put(root, resolvedDependency);
                    }
                    isDependencyResolved = true;
                    break;
                }
            }
            if (!isDependencyResolved) {
                String msg = String.format(MESSAGE_UNRESOLVED_DEPENDENCY, dependency);
                messages.add(new ValidationMessage(severityForUnresolvedDependencies, msg));
                continue;
            }
            // TODO: check for overlapping roots with current filter.xml
        }
        return messages;
    }

    public  DependencyValidator(@NotNull ValidationMessageSeverity severity, ValidationMessageSeverity severityForUnresolvedDependencies, Collection<PackageInfo> dependenciesMetaInfo);

}