title: Proper use of Spring's ResolvableType to determine generic type
body: <p>I'm attempting to use Spring's <code>org.springframework.core.ResolvableType</code> to figure out the parameterized type at runtime as such:</p>
  
  <pre><code>public class MyClass&lt;T&gt; implements MyInterface&lt;T&gt; {
      private final Class&lt;T&gt; typeClass;
  
      public CustomStateSerializer() {
          ResolvableType type = ResolvableType.forClass(getClass());
          ResolvableType genericType = type.getGeneric();
          this.typeClass= (Class&lt;T&gt;) genericType.resolve();
      }
  }
  
  ...
  
  new MyClass&lt;MyType&gt;();
  </code></pre>
  
  <p>Unfortunately, <code>genericType</code> results to <code>?</code>. Clearly I'm not using it correctly and I can't seem to find any good docs for the solution.</p>