title: How to remove elements from a list with lambda based on another list
body: <p>I have List of file Paths: . </p>
  
  <pre><code>List&lt;Path&gt; filePaths; //e.g. [src\test\resources\file\15\54\54_exampleFile.pdf]
  </code></pre>
  
  <p><code>54</code> above refers to file ID</p>
  
  <p>I then obtain a <code>Set</code> of <code>String</code> Ids which my application can handle as follows:</p>
  
  <pre><code>Set&lt;String&gt; acceptedIds = connection.getAcceptedIDs(); //e.g. elements [64, 101, 33]
  </code></pre>
  
  <p>How can I use Java 8 lambdas to <code>filter</code> out all elements in <code>filePaths</code> that do not contain any of the acceptable Ids that are contained in <code>acceptedIds</code> collection Set.</p>
  
  <p>In other words, I would like to retain in <code>filePaths</code> only the paths that have ids which are in <code>acceptedIds</code> set. For example, 54 is not in the above list so is removed.</p>
  
  <pre><code>filePaths.stream().filter(...).collect(Collectors.toList());
  </code></pre>