title: Java Set<String> in a HashMap
body: <p>I have this object: </p>
  
  <pre><code>Map&lt;Long, Set&lt;String&gt;&gt; resourcesByID = new HashMap&lt;Long, Set&lt;String&gt;&gt;();
  </code></pre>
  
  <p>and another:</p>
  
  <pre><code>Set&lt;String&gt; resources;
  </code></pre>
  
  <p>When I want to put more Set into the HashMap it will override the elements of the Set, that I put into previously. Why? And how can I resolve this problem? </p>