title: Flexible return type of method
body: <p>I have a couple of classes (extending AsyncTaskLoader) that all basically do the same thing: make a REST call and create POJOs from the response with Gson. Now I thought it would be more elegant to have just one class (let it take some parameters) and just tell it what kind of object I expect to get back. As a parameter I would give the class of the POJO that I expect to get back because it is used in the Gson deserialization like</p>
  
  <pre><code>Imprint impr = gson.fromJson(responseString, Imprint.class);
  </code></pre>
  
  <p>What would be the return type of the class / method? I thought about letting it return <code>java.lang.Object</code> and then downcast it to the POJO type object that I expect, but is there a better possibility? </p>