title: Delete entry from HashMap
body: <p>I have a HashMap:</p>
  
  <pre><code>public static Map&lt;String, Set&lt;String&gt;&gt; adjMap = new HashMap&lt;String, Set&lt;String&gt;&gt;();
  adjMap.put(title, new HashSet&lt;String&gt;());
  adjMap.get(title).add(cutTitle(graphLink));
  </code></pre>
  
  <p>Now I want do delete all entries from the values (HashSet), which does not contains as a key. </p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>for(String s: adjMap.keySet()){
      for(Set&lt;String&gt; s1: adjMap.values()){
          for(String s2: s1){
              if(!s.contains(s2)){
                  s1.remove(s2);
              }
          }
      }
  }
  </code></pre>
  
  <p>But I get an exception:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.util.ConcurrentModificationException</p>
  </blockquote>