title: Deserializing JSON into a class with a generic argument using GSON or Jackson
body: <p>I'm getting responses from my server that look like:</p>
  
  <pre><code>{
    "timestamp" : 1,
    "some other data": "blah",
    "result" : {
       ...
    }
  }
  </code></pre>
  
  <p>for a variety of calls.  What I want to do client side is:</p>
  
  <pre><code>class ServerResponse&lt;T&gt; {
      long timestamp;
      T result;
  
  }
  </code></pre>
  
  <p>and then deserialize that with GSON or Jackson.  I've been unable to do so thanks to type erasure.  I've cheated that using subclasses like this:</p>
  
  <pre><code>class SpecificResponse extends ServerRequest&lt;SpecificType&gt; {}
  </code></pre>
  
  <p>but that requires a bunch of useless classes to lie around.  Anyone have a better way?</p>
  
  <p>I also need to be able to handle the case of result being an array.</p>