title: Comparator for groups of types
body: <p>I would like to sort array of objects. Each object has <code>getType()</code> method which returns object type in String.</p>
  
  <p>I would like to sort my array depending on the type with something like priorities.</p>
  
  <p>Example: </p>
  
  <pre><code>Input { A, F, Z, G, E, D, C }
  
  If(type == A or B or C or D) top 
  If(type == E) second
  If(type == F or G) third
  If(differet type) last
  
  Output: { A, C, D, E, F, G, Z }
  </code></pre>
  
  <p>How should my comparator look like ?</p>
  
  <p>If I haven't stated my question clear enough, please write a comment, I'll try to explain more briefly the part which is not clear.</p>