title: How can I get the number of type parameters declared in a class?
body: <p>I'd like to get the number of type prameters that a given class declares. For example, the class <code>java.util.List</code> declares one type parameter. <code>java.util.Map</code> declares two. And <code>java.util.function.BiFunction</code> declares three.</p>
  
  <p>Ideally, I'd have a method that accepts a <code>Class</code> object and returns that count. Something like</p>
  
  <pre><code>SomeUtility.getCountOfTypeParameters(java.util.List.class);
  </code></pre>
  
  <p><strong>Note: I'm not interested in the type <em>arguments</em> provided when declaring, for example, a variable of type <code>List&lt;String&gt;</code>.</strong></p>