public E argmin ( Comparator < E > tieBreaker ) { int min = Integer . MAX_VALUE ; E argmin = null ; for ( E key : map . keySet ( ) ) { int count = getIntCount ( 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 . Ties are broken by comparing the objects using the given tie breaking Comparator favoring Objects that are sorted to the front . This is useful if the keys are numeric and there is a bias to prefer smaller or larger values and can be useful in other circumstances where random tie - breaking is not desirable . Returns null if this Counter is empty .