private boolean hasDuplicate(String filePath, Set<Resource> result) {
        if (result.isEmpty()) {
            return false;
        }
        String duplicatePath = (filePath.startsWith("/") ? filePath.substring(1) : "/" + filePath);
        try {
            return result.contains(new UrlResource(ResourceUtils.JAR_URL_PREFIX + ResourceUtils.FILE_URL_PREFIX +
                duplicatePath + ResourceUtils.JAR_URL_SEPARATOR));
        } catch (MalformedURLException ex) {
            // Ignore: just for testing against duplicate.
            return false;
        }
    }
Check whether the given file path has a duplicate but differently structured entry
in the existing result, i.e. with or without a leading slash.

@param filePath the file path (with or without a leading slash)
@param result   the current result
@return {@code true} if there is a duplicate (i.e. to ignore the given file path),
{@code false} to proceed with adding a corresponding resource to the current result
analyzer/src/main/java/nl/basjes/parse/useragent/utils/springframework/core/io/support/PathMatchingResourcePatternResolver.java