title: How to resolve: parameter never used with T type while T itself is used?
body: <p>I am facing with a Java Warning (&quot;Parameter myParameter is never used&quot;) on my generic method where I use type of the parameter (T) but not the parameter value itself. Can I avoid this warning without using SuppressWarnings annotation?</p>
  <pre><code>private &lt;T extends MyInterface&gt; MyGenericObject&lt;T&gt; init(Class&lt;T&gt; myParameter) {
     // lots of common code here ... and:
     return new MyGenericObject&lt;T&gt;();
  }
  </code></pre>
  <p>The way I use this method at the moment:</p>
  <pre><code>MyGenericObject&lt;MyClassA&gt; aInstance = init(MyClassA.class);
  MyGenericObject&lt;MyClassB&gt; bInstance = init(MyClassB.class);
  </code></pre>
  <p>Perhaps there must be a way to pass only the type to my method without parameter, but I cannot find the way for it. Could you please help me out with that?</p>