title: Create generic List
body: <p>How I can create genric List in Java? I also can pass <code>Class&lt;T&gt;</code> instance to the method.</p>
  
  <p>Like this: </p>
  
  <pre><code>public static &lt;T&gt; List&lt;T&gt; createList(Class&lt;T&gt; clazz) {
      List&lt;T&gt; list = new ArrayList&lt;T&gt;();
  
      list.add(clazz.newInstance());
  
      return list;
  }
  </code></pre>