Gson fromJson using generic super class
<p>I'm trying to get a json array to deserliaze when using generics, see my work below:</p>

<pre><code>public class Lookup&lt;T extends Profile&gt; {

    protected final Class&lt;T&gt; getSuperClass() {
        ParameterizedType superClass = (ParameterizedType)this.getClass().getGenericSuperclass();
        return (Class&lt;T&gt;)(superClass.getActualTypeArguments().length == 0 ? BasicProfile.class : superClass.getActualTypeArguments()[0]);
    }

    protected final Class&lt;T[]&gt; getSuperClassArray() {
        ParameterizedType superClass = (ParameterizedType)this.getClass().getGenericSuperclass();
        return (Class&lt;T[]&gt;)(superClass.getActualTypeArguments().length == 0 ? BasicMojangProfile[].class : superClass.getActualTypeArguments());
    }

    public void doWork() { // This Works
        String jsonText = "{id=3, name=Derp}";
        T result = new Gson().fromJson(jsonText, this.getSuperClass());
        // Will be whatever T is (defined elsewhere), unless this class
        // is created without a super class then properly defaults to
        // the BasicProfile
    }

    public void doArrayWork() { // DOES NOT WORK
        String jsonText = "[{id=3, name=Derp}]";
        T[] result = new Gson().fromJson(jsonText, ?);
        // Have tried the following (in place of the ?):
        // new TypeToken&lt;T&gt;(){}.getType()
        // new TypeToken&lt;T[]&gt;(){}.getType()
        // new TypeToken&lt;List&lt;T&gt;&gt;(){}.getType() // with List&lt;T&gt; result
        // this.getSuperClassArray()
    }

}
</code></pre>

<p>How can I get doArrayWork to function properly? I do not want to pass whatever T is as a parameter to the method.</p>