title: Converting from EnumSet<A> to Set<B> when A inherits from B
body: <p>The title pretty much explains the question. I have an interface method:</p>
  
  <pre><code>Set&lt;Field&gt; getFieldSet()
  </code></pre>
  
  <p>and I have a class, <code>User</code> which looks something like this</p>
  
  <pre><code>class User {
      enum Fields implements Field {
          USERNAME, PASSWORD;
          ...
      }
      ...
  }
  </code></pre>
  
  <p>Now I want to implement <code>User</code>'s <code>getFieldSet()</code> method. The naive way seems to just <code>return EnumSet.allOf(Fields.class)</code> but I get the following error:</p>
  
  <pre><code>&gt; Type mismatch: cannot convert from Set&lt;User.Fields&gt; to Set&lt;Field&gt;
  </code></pre>
  
  <p>Other than manually copying the EnumSet to <code>Set&lt;Field&gt;</code>, is there a good way to do this?</p>