title: IntersectWith And RemovesWith with List of Lists
body: <p>I have a <code>List</code> of <code>List&lt;Foo&gt;.</code> I am trying to make two new collections of <code>List&lt;Foo&gt;</code> that contains the similarities and differences. I have read a lot of posts on this site, most deal with single Lists while I am dealing with a collection of multiple, below is my solution:</p>
  
  <pre><code>List&lt;List&lt;Foo&gt;&gt; listOfLists = [Build up the list, not important]
  
  HashSet&lt;Foo&gt; same = listOfLists
  .Skip(1)
  .Aggregate(
  new HashSet&lt;Foo&gt;(listOfLists.First()),
  (h, e) =&gt;
  {
  h.IntersectWith(e);
  return h;
  }
  );
  
  HashSet&lt;Foo&gt; diff = listOfLists
  .Skip(1)
  .Aggregate(
  new HashSet&lt;Foo&gt;(listOfLists.First()),
  (h, e) =&gt;
  {
  h.ExceptWith(e);
  return h;
  }
  );
  </code></pre>
  
  <p>However on the  <code>diff</code> method, it seems to only return the different <code>Foo</code> collections from the second <code>List&lt;Foo&gt;</code> in the <code>ListsofLists</code> collection. </p>