class DefaultDependencyUpgrader implements DependencyUpgrader {
    private Logger logger = LoggerFactory.getLogger(this.getClass());
    Dependency installed;
    Dependency  dependency;
    List<Map<String, Object>> shouldUpdateVersionList;
    private Map<String, Object> context;
    private boolean             firstInstall;

    public DefaultDependencyUpgrader(Dependency installed, Dependency dependency, Map<String, Object> context) {
        this.firstInstall = installed == null;
        if (firstInstall) {
            this.installed = dependency;
        } else {
            this.installed = installed;
        }
        this.context = context;
        this.dependency = dependency;
    }

    @Override
    public DependencyUpgrader filter(List<Map<String, Object>> versions) {<FILL_FUNCTION_BODY>}

    @Override
    public void upgrade(CallBack callBack) {
        shouldUpdateVersionList.forEach(context -> {
            if (this.context != null) {
                context.putAll(this.context);
            }
            if (logger.isInfoEnabled()) {
                logger.info("upgrade [{}/{}] to version:{} {}", dependency.getGroupId(), dependency.getArtifactId(), context.get("version"), dependency.getWebsite());
            }
            callBack.execute(context);
        });
    }

}

        shouldUpdateVersionList = versions.stream()
                .filter(map -> {
                    String ver = (String) map.get("version");
                    if (null == ver) {
                        return false;
                    }
                    //首次安装
                    if (firstInstall) {
                        return true;
                    }
                    //相同版本
                    if (installed.compareTo(dependency) == 0) {
                        return false;
                    }

                    return installed.compareTo(new SystemVersion(ver)) < 0;
                })
                .sorted(Comparator.comparing(m -> new SystemVersion((String) m.get("version"))))
                .collect(Collectors.toList());
        return this;
    
<no_super_class>