title: Java assigning Set of Interface
body: <p>I think this is simple question, but I stuck on it.
  I am trying to assign one Set to another:</p>
  
  <pre><code>Set&lt;Registrable&gt; rr =kart.getReg();  
  </code></pre>
  
  <p>where kart.getReg() return Set of Reg:</p>
  
  <pre><code>public class Kart {
  public Set&lt;Reg&gt; getReg() {
      return reg;
  }
  ...
  </code></pre>
  
  <p>but "Registrable" is an interface, defined like:</p>
  
  <pre><code> public interface Registrable  {
      getters...
      setters...
   }
  </code></pre>
  
  <p>and finally the class "Reg" is:</p>
  
  <pre><code> public class Reg implements Registrable {
      getters...
      setters...
   }
  </code></pre>
  
  <p>and my compiler wrote:</p>
  
  <pre><code>Type mismatch: cannot convert from Set&lt;Reg&gt; to Set&lt;Registrable&gt;
  </code></pre>
  
  <p>Any help will be appreciated!</p>