title: Multiple instanceof in a if statement
body: <p>I have a if statement, with multiple instanceof checks. Example:</p>
  
  <pre><code>if (object instanceof Object1) {
      // do something
  } else if (object instanceof Object2) {
      // to something else
  } else if (object instanceof Object2) {
      // and something else
  } ...
  </code></pre>
  
  <p>What would be a more elegant way to solve this if-else-query?</p>