title: How to make a List[CaseObj] distinct based on a property of CaseObj?
body: <p>Usually I call distinct on List to remove duplicates or turn it into a <code>Set</code>. Now I have a <code>List[MyObject]</code>. <code>MyObject</code> is a case class, see below:</p>
  
  <pre><code>case class MyObject(s1: String, s2:String, s3:String) 
  </code></pre>
  
  <p>Let's say we have the following cases:</p>
  
  <pre><code>val myObj1 = MyObject("", "gmail,com", "some text")
  val myObj2 = MyObject("", "gmail,com", "")
  val myObj3 = MyObject("some text", "gmail.com", "")
  val myObj4 = MyObject("some text", "gmail.com", "some text")
  val myObj5 = MyObject("", "ymail.com", "")
  val myObj6 = MyObject("", "ymail.com", "some text")
  
  val myList = List(myObj1, myObj2, myObj3, myObj4, myObj5, myObj6)
  </code></pre>
  
  <p><strong>Two Questions:</strong></p>
  
  <ol>
  <li>How can I count how many objects are affected? Duplicates based on the content of <code>s2</code>?</li>
  <li>How can I make the List distinct based on <code>s2</code>? I would consider two case objects the same when <code>s2 == s2</code>. Do I need to turn the case class into a normal class and override equals? Do I need a my own Comparator for this or can I use some Scala API method to archive the same?</li>
  </ol>