title: Picking a random Key and Value from a Map?
body: <p>Here's a seemingly trivial coding task that I just can't seem to find an elegant solution for. Perhaps it's a Sunday afternoon 'dumbness' thing but I'm just not seeing it.</p>
  
  <p>I have a Map that represents a set of names for a group:</p>
  
  <pre><code>  1. Map&lt;String, Set&lt;String&gt;&gt; namesForGroup;
  </code></pre>
  
  <p>With content that looks something like this:</p>
  
  <pre><code>1 {"Grp1": {"a", "b", "c", "d"},
  2 "Grp2": {"e", "f", "g", "h"}}
  </code></pre>
  
  <p>What I'd like is an elegant way to extract a random Key Value pair from that Map. For example:</p>
  
  <pre><code>1 ["Grp1", "a"]
  2 ["Grp1", "d"]
  3 ["Grp2", "g"]
  4 ["Grp1", "c"]
  5 ["Grp2", "e"]
  </code></pre>
  
  <p>There is no requirement for any strong randomness or any even distribution of the chosen values. A rough approximation is all that is required as I'm just generating some test data for a performance benchmark I'm writing for a new feature I've written at work.</p>
  
  <p>Thanks</p>