title: java EnumSet, incompatible types: inference variable E has incompatible bounds
body: <p>I have a the below method which returns a enum set containing all of the elements of <code>Types</code>:</p>
  
  <pre><code>@Override
  public EnumSet&lt;?&gt; groupTypes() {
      return EnumSet.allOf(Types.class);
  }
  </code></pre>
  
  <p>And the <code>Types</code> is an <code>enum</code> like below:</p>
  
  <pre><code>public enum Types implements GroupType {
      ASG;
  }
  </code></pre>
  
  <p>The <code>GroupType</code> interface is:</p>
  
  <pre><code> public interface GroupType extends NamedType {
  
   }
  </code></pre>
  
  <p>The <code>NamedType</code> interface:</p>
  
  <pre><code>public interface NamedType {
  
      String name();
  
  }
  </code></pre>
  
  <p>When compile, I got the below error:</p>
  
  <pre><code>    error: incompatible types: inference variable E has incompatible bounds
  return EnumSet.allOf(Types.class);
                          ^
  
  equality constraints: Types
      upper bounds: Enum&lt;CAP#1&gt;,Enum&lt;E&gt;
    where E is a type-variable:
      E extends Enum&lt;E&gt; declared in method &lt;E&gt;allOf(Class&lt;E&gt;)
    where CAP#1 is a fresh type-variable:
      CAP#1 extends Enum&lt;CAP#1&gt; from capture of ?
  </code></pre>