title: Is it possible to declare two wildcard types to be of same type?
body: <p>I want to create a mapping from (a) class type to (b) long (the identifier of the object of the defined class type) to (c) the object itself.</p>
  
  <p>I have the following:</p>
  
  <pre><code> protected HashMap&lt;Class&lt;?&gt;, HashMap&lt;Long, ?&gt;&gt; obj = new HashMap&lt;Class&lt;?&gt;, HashMap&lt;Long, ?&gt;&gt;();
  </code></pre>
  
  <p>Is it possible to somehow denote that the first <code>?</code> must be of the same type than the second <code>?</code>? I would expect something like this, but this is ofcourse not possible:</p>
  
  <pre><code>protected &lt;T&gt; HashMap&lt;Class&lt;T&gt;, HashMap&lt;Long, T&gt;&gt; obj = new HashMap&lt;Class&lt;T&gt;, HashMap&lt;Long, T&gt;&gt;();
  </code></pre>