title: Java / Returning a dynamic Object type
body: <p>Two methods currently return identical objects, differing only in object name.</p>
  
  <pre><code>Animal getEntity(e) {
      ...
      return Animal
  }
  
  Person getEntity(e) {
      ...
      return Person
  }
  </code></pre>
  
  <p>Ideally, I could construct a method which would return a type dynamically, based on how it's called. Does this make any sense? </p>
  
  <p>When I was looking for examples of <code>&lt;T&gt; T</code>, it wasn't clear how I could return a specified type. Elsewhere, a gremlin called "type erasure" seems to be bandied about. Am I barking up the wrong tree? What should I be looking for? </p>