title: java static generic hashmap with static generic method
body: <p>I have got something like that:</p>
  
  <pre><code>private  static LinkedHashMap&lt;Class&lt;?&gt;, ?&gt; configFiles;
  </code></pre>
  
  <p>and static method: </p>
  
  <pre><code>@SuppressWarnings("unchecked")
  public static &lt;T&gt; T getConfigFile(Class&lt;T&gt; clazz) throws Exception {
  
      return (T) configFiles.get(clazz);
  }
  </code></pre>
  
  <p>but I have got init method: </p>
  
  <pre><code>configFiles = new LinkedHashMap&lt;Class&lt;T&gt;, T&gt;();
  </code></pre>
  
  <p>and its no compile:/</p>
  
  <p>But if I do something like that: </p>
  
  <pre><code>@SuppressWarnings("unchecked")
      @Override
      public void intitConfigFiles() 
          throws ClassNotFoundException, ConfigurationFilesException
      {
          configFiles = new LinkedHashMap&lt;Class&lt;?&gt;, T&gt;();
      }
  </code></pre>
  
  <p>its working but i don't know how can i use method put:/</p>
  
  <pre><code>Class&lt;T&gt; clazz = (Class&lt;T&gt;) Class.forName(prop.getValue());
  
      jc = JAXBContext.newInstance(clazz);
          u = jc.createUnmarshaller();
          configFiles.put( clazz,  u.unmarshal(inputStream));
  </code></pre>
  
  <p>and I have got error in Eclipse I don't know how to correct use put method?</p>