title: A method that should only accept instances of A or B or C in Scala
body: <p>I would ensure that a method should only accept instances of <code>A</code> or <code>B</code> or <code>C</code>. And I don't want to modify the code of <code>A</code>, <code>B</code> and <code>C</code>.</p>
  
  <pre><code>case class A
  case class B
  case class C
  def method(aOrbOrc: Any) = ???
  
  // method("toto") should not compile
  </code></pre>