title: Generic Type Specification for Class Object
body: <p>I'm using a HashMap and the method show below to track change listeners for class types. The IDE is giving a warning </p>
  
  <pre><code>[rawtypes] found raw type: java.lang.Class
    missing type parameters for generic class java.lang.Class&lt;T&gt;. 
  </code></pre>
  
  <p>What type for Class needs to be specified to resolve the warning?</p>
  
  <pre><code>private HashMap&lt;Class, Set&lt;ChangeListener&gt;&gt; classChangeListeners;
  
  /**
   * Adds a ChangeListener to the listener list for the specified class type. The class type
   * specified must be a subclass of {@link BusinessObject}.
   *
   * @param  &lt;T&gt;  the type of BusinessObject.
   * @param  cls  the class type.
   * @param  listener  the ChangeListener to be added.
   */
  public &lt;T extends BusinessObject&gt; void addChangeListener(Class&lt;T&gt; cls, ChangeListener listener)
  {
   if (!classChangeListeners.containsKey(cls))
   {
    classChangeListeners.put(cls, new TreeSet&lt;ChangeListener&gt;());
   }
  
   classChangeListeners.get(cls).add(listener);
  }
  </code></pre>