class ClassLoaderUtils {

    public static String generateAdditionalUrlsFingerprint(Set<URL> urls) {
        List<String> listOfUrls = urls.stream().map(Object::toString).collect(Collectors.toList());
        StringBuffer urlBuffer = new StringBuffer();

        //Sorting so that the order is maintained for generating the fingerprint
        Collections.sort(listOfUrls);
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            listOfUrls.forEach(url -> {
                urlBuffer.append(url).append("-").append(getLastModified(url)).append(";");
            });
            byte[] bytesOfAdditionalUrls = urlBuffer.toString().getBytes("UTF-8");
            byte[] bytesOfDigest = md.digest(bytesOfAdditionalUrls);

            return DatatypeConverter.printHexBinary(bytesOfDigest);
        } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
            LOGGER.error("Unable to generate fingerprint for the provided additional resources {}", new Object[]{urls, e});
            return null;
        }
    }

}