title: iterating an enum with a while loop
body: <p>Sorry for the very noob question.
  Let's suppose I have an enum like so</p>
  
  <pre><code>public enum MyElementType {
  TYPE_ONE,
  TYPE_TWO,
  TYPE_THREE;
  }
  </code></pre>
  
  <p>When I want to loop over this enum, I always see this solution:</p>
  
  <pre><code>for(MyElementType type: MyElementType.values())
  {
  //do things
  }
  </code></pre>
  
  <p>I wonder if there exist a viable solution with the while loop.
  Seraching around I see that Enumeration interface exposes the method
      hasMoreElements()
  but I don't know how to link the things together.
  Any advice?</p>