title: Compare two List<T> objects for equality, ignoring order
body: <p>Yet another list-comparing question.</p>
  
  <pre><code>List&lt;MyType&gt; list1;
  List&lt;MyType&gt; list2;
  </code></pre>
  
  <p>I need to check that they both have the same elements, regardless of their position within the list. Each <strong>MyType</strong> object may appear multiple times on a list. Is there a built-in function that checks this? What if I guarantee that each element appears only once in a list?</p>
  
  <p><strong>EDIT:</strong> Guys thanks for the answers but I forgot to add something, the number of occurrences of each element should be the same on both lists.</p>