question: public static < K , V extends Comparable < V > > List < Entry < K , V > > sortByValue ( Map < K , V > map ) { List < Entry < K , V > > entries = new ArrayList < > ( map . entrySet ( ) ) ; Collections . sort ( entries , new ByValue < K , V > ( ) ) ; return entries ; }
target:  Generic method to sort a map by value