title: JAVA Initialize a HashMap while declaring it
body: <p>I am currently working with a prefilled Hashmap, but I cannot come up with an efficient way to declare a Hashmap instantly.
  One way I can do it is:</p>
  <pre><code>static final LinkedHashMap&lt;String, Integer&gt; test = new LinkedHashMap&lt;String, Integer&gt;() {{
  
  }}
  </code></pre>
  <p>But I was told that this way is not good because of runtime etc..
  I need a way though, to fill the List instantly and not in a method, because the method where I need it is accessed multiple times.</p>