title: Shuffling values in HashMap
body: <p>I would like to shuffle values in an HashMap. I have following type of HashMap</p>
  
  <pre><code>Map&lt;Integer,ArrayList&lt;String&gt; &gt; trainDataSet = new HashMap&lt;Integer, ArrayList&lt;String&gt;&gt;();
  </code></pre>
  
  <p>I would like to shuffle the values in the Map. How would i do it? </p>
  
  <p>Following is my attempt:</p>
  
  <pre><code>    collections.shuffle(trainDataSet.values());
  </code></pre>
  
  <p>Got an error:</p>
  
  <pre><code>    Values cannot be cast to java.util.List
  </code></pre>
  
  <p>Yes this make sense, because my values are in Arraylist not in List. Would it be possible to shuffle collections of arraylist?</p>
  
  <p>EDIT</p>
  
  <p>If i have following order::</p>
  
  <pre><code>key1  [aa,bb,cd]
  key2  [xx,xy,sfr]
  </code></pre>
  
  <p>Into something like</p>
  
  <pre><code>key1  [xx,xy,sfr]
  key2  [aa,bb,cd]
  </code></pre>