title: Compare Set & List in my case
body: <p>I have  a <code>List&lt;Integer&gt;</code> , this list contains duplicated elements:</p>
  
  <pre><code>//myList content is something like e.g. 1,2,1,3,3,6,7,...
  List&lt;Integer&gt; myList = getNumbers();
  </code></pre>
  
  <p>I have also an <code>Set&lt;String&gt;</code> , as you all know, <code>Set</code> only contain unique elements, no duplicated one. My <code>Set&lt;String&gt;</code> contains String-type-integers:</p>
  
  <pre><code>//The Set content is String type integer , e.g. "1", "3", "5" …
  Set&lt;String&gt; mySet = getNumSet(); 
  </code></pre>
  
  <p>I would like to compare <code>mySet</code> with <code>myList</code> to figure out what elements <code>mySet</code> has but <code>myList</code> doesn't have &amp; remove those elements from <code>mySet</code>. </p>
  
  <p>The way I do now is to use nested iteration like following: </p>
  
  <pre><code>for(Integer i : myList){
     for(String s : mySet){
           if(!myList.contains(Integer.valueOf(s))){
                 mySet.remove(s);
           }
      }   
  
  }
  </code></pre>
  
  <p>Is there more efficient way than mine to do it?</p>