private List < PatternCacheControl > sortByMatchingPatternCount ( Map < String , PatternCacheControl > unsortedMap ) { List < PatternCacheControl > list = new ArrayList <> ( unsortedMap . values ( ) ) ; Collections . sort ( list , PATTERN_CACHE_CONTROL_COMPARATOR ) ; return list ; }
Sorts the patterns map by the number of matching patterns and returns a list of sorted PatternCacheControl elements . The sorted list is used at request so that a file s URL can be matched to the most specific pattern .