pickWeightedProbability

public static Integer pickWeightedProbability(Map<Integer, Double> weighedValues)

Picks a key from the map with a probability proportional to its weight.

Return

the picked key, or null when nothing could be picked (empty map or non-positive weights) - callers must handle null