question: private List < Match < T > > sort ( final Map < String , Match < T > > possibleMatches ) { List < String > keys = new ArrayList < > ( possibleMatches . keySet ( ) ) ; Collections . sort ( keys , matchComparator ) ; List < Match < T > > matches1 = new ArrayList < > ( possibleMatches . size ( ) ) ; for ( String key : keys ) { matches1 . add ( possibleMatches . get ( key ) ) ; } return matches1 ; }
target:  Sort the matches according to their precedence (that is, according to the precedence of their keys).