title: Java: convert HashMap values to Set<Integer>
body: <p>One more question about HashMap&lt;> in Java:</p>
  
  <p>I have the following</p>
  
  <pre><code>Map&lt;String, Set&lt;Integer&gt;&gt; myWordDict = new HashMap&lt;String, Set&lt;Integer&gt;&gt;();
  </code></pre>
  
  <p>After storing data into the variable <code>myWordDict</code>, I want to iterate through the HashMapValues, and add each value to a new Set variable?</p>
  
  <p>When I try to do <code>Set&lt;Integer&gt; newVariable = myWordDict.entrySet()</code>, it seems the data type is incompatible. </p>
  
  <p><strong>So my question is essentially:</strong> </p>
  
  <blockquote>
    <p>how to convert HashMap values or entrySet() to Set ?</p>
  </blockquote>
  
  <p>Thanks</p>