title: Nicest way to write a class that contains multiples enums with common fields
body: <p>Let's assume that I have a class Test, which contains multiples enums. Theses contains always the same fields, and have one common constructor. What can be the nicest way to refactor this ?</p>
  
  <p>Thank you. I saw some similar topics but I didn't saw that case.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>public final class Test{
  
      public enum A {
           MyField1("1", "2"),
           MyField2("3", "4"),
           MyField3("5", "6"),
  
           private final String key;
           private final String shortcut;
  
           A(String k, String s){ 
               this.key= k;
               this.shortcut= s;
           }
  
           public String getKey() { return key; }
           public String getShortcut() { return shortcut; }
      }
  
      public enum B {
           MyField1("1", "2"),
           MyField4("7", "8"),
           MyField5("9", "10"),
  
           private final String key;
           private final String shortcut;
  
           B(String k, String s){ 
               this.key= k;
               this.shortcut= s;
           }
  
           public String getKey() { return key; }
           public String getShortcut() { return shortcut; }
      }
  
      public enum C {
           MyField1("1", "2"),
           MyField6("11", "12"),
           MyField7("13", "14"),
  
           private final String key;
           private final String shortcut;
  
           C(String k, String s){ 
               this.key= k;
               this.shortcut= s;
           }
  
           public String getKey() { return key; }
           public String getShortcut() { return shortcut; }
      }
  
  }
  </code></pre>