title: Why a Map with superclass values can't accept subclass objects?
body: <p>I have two classes: superclass Cluster and subclass XCluster. XCluster extends Cluster.</p>
  
  <p>I have this method signature:</p>
  
  <pre><code>public Map&lt;Integer, XCluster&gt; getClusters() {
  ...
  }
  </code></pre>
  
  <p>I have this variable: </p>
  
  <pre><code>Map&lt;Integer, Cluster&gt; clusters = getClusters();
  </code></pre>
  
  <p>I can't compile this. Eclipse says that the method getCluster() doesn't return this kind of type. That I need to change the type from XCluster to Cluster.</p>
  
  <p>What's wrong?</p>