title: iterating and filtering two lists using java 8
body: <p>I want to iterate two lists and get new filtered list which will have values not present in second list. Can anyone help?</p>
  
  <p>I have two lists - one is list of strings, and the other is list of <code>MyClass</code> objects.</p>
  
  <pre><code>List&lt;String&gt; list1;
  List&lt;MyClass&gt; list2;
  
  MyClass {
  
      MyClass(String val)
      {
          this.str = val;
      }
  
       String str;
       ...
       ...
  }
  </code></pre>
  
  <p>I want filtered list of strings based on -> check second list for elements (abc) whose values not present in <code>list1</code>.</p>
  
  <pre><code>List&lt;String&gt; list1 = Arrays.asList("abc", "xyz", "lmn");
  
  List&lt;MyClass&gt; list2 = new ArrayList&lt;MyClass&gt;();
  
  MyClass obj = new MyClass("abc");
  list2.add(obj);
  obj = new MyClass("xyz");
  list2.add(obj);
  </code></pre>
  
  <p>Now I want new filtered list -> which will have value => "lmn". i.e. values not present in <code>list2</code> whose elements are in <code>list1</code>.</p>