title: How to make scala List of Any have a mandatory attribute?
body: <p>I'm new to scala and OOP in general, therefore I apologize in advance if the question is stupid, but I really don't know how to find what I'm looking for.</p>
  
  <p>I have the following code </p>
  
  <pre><code>case clase MyClass(id: Int, active: Boolean)
  case class MyOtherClass(name: String, active: Boolean)
  
  
  private def myMethod(active: Boolean, list: List[MyClass]): List[MyClass] = {
    if(active){
        list.filter(_.active == true)
    }else{
        list.filter(_.active == false)
    }
  }
  </code></pre>
  
  <p>Ok now, what I want to do is to make this "myMethod" take a List of "Any" instead of a specific class as long as it has an "active" attribute. How should I go about it?</p>
  
  <p>For instance, the class:</p>
  
  <pre><code> case class MyThridClass(name: String)
  </code></pre>
  
  <p>wouldn't work since it doesn't have an "active" attribute</p>