title: Check if an object is instance of List of given class name
body: <p>Given an <code>Object o</code> and a <code>String className = "org.foo.Foo"</code>, I want to check if <code>o</code> is instance of <code>List&lt;className&gt;</code></p>
  
  <p>I tried this but won't compile:</p>
  
  <pre><code>Class&lt;?&gt; cls = Class.forName(className);
  if (o instanceof List&lt;cls&gt;){ // this gives error: cls cannot be resolved to a type
    doSomething();
  }
  </code></pre>
  
  <p>Please note that my inputs are <code>Object o</code> and <code>String className</code> (please mind types).</p>