title: Serialize a "Dog" as if it was an "Animal" using Gson
body: <p>I have a <strong>concrete</strong> base class, <code>Animal</code>, and several subclasses <code>Dog</code>, <code>Cat</code> and so on.</p>
  
  <p>The details of <code>Dog</code> and <code>Cat</code> are irrelevant, so I would like to serialize instances of these subclasses the same way as <code>Animal</code>s are serialized.</p>
  
  <p>There are quite a few such subclasses so I would prefer a solution that doesn't list them all. Something based on an <code>instanceof Animal</code> would be ideal.</p>