class ComponentBuildNumberComparator {

    boolean compare(Image currentImage, Image newImage, String buildNumberKey) {
        Optional<String> currentVersion = getBuildVersion(currentImage, buildNumberKey);
        Optional<String> newVersion = getBuildVersion(newImage, buildNumberKey);
        return currentVersion.isPresent() && newVersion.isPresent() && compare(currentVersion, newVersion);
    }

}