title: Static HashMap Initialization
body: <p>I have this class, I want to know:<br/>
  1° Is this the best way to define a static HashMasp<br/>
  2° Is this the best way to do it in a Spring based app?(does Spring offer a better way to do this?)<br/></p>
  
  <p>Thanks in advance!</p>
  
  <pre><code>    public class MyHashMap {
          private static final Map&lt;Integer, String&gt; myMap;
          static {
              Map&lt;CustomEnum, String&gt; aMap = new HashMap&lt;CustomEnum, String&gt;();
              aMap.put(CustomEnum.UN, "one");
              aMap.put(CustomEnum.DEUX, "two");
              myMap = Collections.unmodifiableMap(aMap);
          }
  
          public static String getValue(CustomEnum id){
              return myMap.get(id);
          }
      }
  
  
      System.out.println(MyHashMap.getValue(CustomEnum.UN));
  </code></pre>