code: public <T> T pick (Map<? extends T, ? extends Number> weightMap, T ifEmpty)
      {
          Map.Entry<? extends T, ? extends Number> pick = pick(
                  weightMap.entrySet(), null, new Weigher<Map.Entry<?, ? extends Number>>() {
                      public double getWeight (Map.Entry<?, ? extends Number> entry) {
                          return entry.getValue().doubleValue();
                      }
                  });
          return (pick == null) ? ifEmpty : pick.getKey();
      }
docs: Pick a random <em>key</em> from the specified mapping of weight values, or return
  <code>ifEmpty</code> if no mapping has a weight greater than <code>0</code>. Each
  weight value is evaluated as a double.
  
  <p><b>Implementation note:</b> a random number is generated for every entry with a
  non-zero weight after the first such entry.
  
  @throws NullPointerException if the map is null.
  @throws IllegalArgumentException if any weight is less than 0.