title: How to find out if a field is instanceof a type via reflection?
body: <p>I want to find out via reflection if a field is an instance of some type <code>T</code>. </p>
  
  <p>Lets say I have an object <code>o</code>. Now I want to know if it has any fields which are instance of <code>T</code>. I can get all fields with:</p>
  
  <pre><code>o.getClass().getFields();
  </code></pre>
  
  <p>I can get the type of the field with:</p>
  
  <pre><code>field.getType();
  </code></pre>
  
  <p>But now I want to know if this type or any supertype equals <code>T</code>. Do I have to call <code>getSuperclass()</code> recursively to be sure to check all supertypes?</p>