class JarScanner {

    URL[] download(Collection<String> urls) {

        ArrayList<URL> downloadedURLs = urls.stream().map(url -> {
            URI uri = URI.create(url);
            String downloaderImplClassName = properties.getProperty(String.format("fs.%s.impl", uri.getScheme()));
            if (null == downloaderImplClassName) {
                throw new RuntimeException(
                        new UnsupportedSchemeException(uri.getScheme() + " is not supported for downloading jars"));
            }
            try {
                Class clazz = Class.forName(downloaderImplClassName);
                if (JarDownloader.class.isAssignableFrom(clazz)) {
                    try {
                        return ((JarDownloader) clazz.newInstance()).download(url).toUri().toURL();
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                } else {
                    throw new RuntimeException("Unsupported implementation " + downloaderImplClassName
                            + " of " + JarDownloader.class.getSimpleName());
                }
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(e);
            }
        })  .collect(Collectors.toCollection(ArrayList::new));
        return downloadedURLs.toArray(new URL[downloadedURLs.size()]);
    }

    public  JarScanner();

}