title: How to sort a List<Enum, Collection> by order of an enum?
body: <p>Enum:</p>
  
  <pre><code> public enum ComponentType {
      INSTRUCTION, ACTION, SERVICE, DOMAIN, INTEGRATION,  OTHER, CONTEXT;
   }
  </code></pre>
  
  <p>Class A :</p>
  
  <pre><code> public class A
   {
      String name;
      ComponentType c;
      public A(String name, ComponentType c)
      {
        this.name = name;
        this.c = c;
      }
  
   }   
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code> List&lt;A&gt; l = new ArrayList&lt;A&gt;();
   l.add(new A("ZY", ACTION));  
   l.add(new A("ZY0", INSTRUCTION));  
   l.add(new A("ZY1", DOMAIN));  
   l.add(new A("ZY2", SERVICE));  
   l.add(new A("ZY3", INSTRUCTION));  
   l.add(new A("ZY4", ACTION));  
  </code></pre>
  
  <p>How to sort list according to enum order?</p>