public static < E > E argmin ( Counter < E > c ) { double min = Double . POSITIVE_INFINITY ; E argmin = null ; for ( E key : c . keySet ( ) ) { double count = c . getCount ( key ) ; if ( argmin == null || count < min ) { // || (count == min && // tieBreaker.compare(key, argmin) < // 0)) { min = count ; argmin = key ; } } return argmin ; }
Finds and returns the key in this Counter with the smallest count .