How do I check if a type is a subclass of another type?
<p>I need to check if an instance of the reflection Field type, as retrieved by Field.getType() is an instance of another class that extends a specific class, GenericModel.</p>

<p>I'm trying something as in the following pseudo code snippet:</p>

<pre><code>if(field.getType() "is_a_superclass_of" GenericModel) {
    ... then do something with it
}
</code></pre>

<p>How do I do this?</p>

<p>When I try something like:</p>

<pre><code>field.getType().isAssignableFrom(Language.class)
</code></pre>

<p>I get a result, true, which means it is of the Language class, which extends GenericModel. However;</p>

<pre><code>field.getType().isAssignableFrom(GenericModel.class)
</code></pre>

<p>returns false?</p>

<pre><code>field.getType() == "za.co.company.package.model.Language"
</code></pre>
