title: Scala match/case statement when matching Java Interfaces
body: <p>I'm using the Scala <code>match/case</code> statement to match an interface of a given java class. I want to be able to check if a class implements a combination of interfaces. The only way I can seem to get this to work is to use nested <code>match/case</code> statements which seems ugly.</p>
  
  <p>Lets say I have a PersonImpl object which implements Person, Manager and Investor. I want to see if PersonImpl implements both Manager and Investor. I should be able to do the following:</p>
  
  <pre><code>person match {
    case person: (Manager, Investor) =&gt;
      // do something, the person is both a manager and an investor
    case person: Manager =&gt;
      // do something, the person is only a manager
    case person: Investor =&gt;
      // do something, the person is only an investor
    case _ =&gt;
      // person is neither, error out.
  }
  </code></pre>
  
  <p>The <code>case person: (Manager, Investor)</code> just doesn't work. In order to get it to work I have to do the following which seem ugly.</p>
  
  <pre><code>person match {
    case person: Manager = {
      person match {
        case person: Investor =&gt;
          // do something, the person is both a manager and investor
        case _ =&gt;
          // do something, the person is only a manager
      }
    case person: Investor =&gt;
      // do something, the person is only an investor.
    case _ =&gt;
      // person is neither, error out.
  }
  </code></pre>
  
  <p>This is just plain ugly. Any suggestions?</p>