title: Iterate over an Enum bounded type parameter
body: <p>I have a class <code>A</code> that depends on a type parameter <code>E</code>, which I want to bound as an <code>enum</code>.  This is what I did:</p>
  <pre><code>public class A&lt;E extends Enum&lt;E&gt;&gt; {}
  </code></pre>
  <p>But then I can't iterate over the elements of the enum.  Here is an example:</p>
  <pre><code>public class A&lt;E extends Enum&lt;E&gt;&gt; {
      public void display() {
          for(E e : E.values())
              System.out.println(e);
      }
  }
  </code></pre>
  <p>It doesn't work because it <em>Cannot resolve method 'values' in 'E'</em>.</p>
  <p>What should I do instead to have the type parameter bounded to be an <code>enum</code> which can really behave like an <code>enum</code>?</p>
  <p>Edit:
  All the solutions in the linked question are not applicable, since inside of the <code>display</code> method I don't have access to any concrete object of type <code>E</code>.</p>