title: Put values in Hashmap from external methods?
body: <p>I want to do something like in this example. I can't figure out why it is not working. 
  myMap has no value in the main class. But if I put the value in the "putSomethingInTheMap" into the map it has the right value in the main class.</p>
  
  <p>Can you give me a suggestion how to handle something like this? </p>
  
  <pre><code>public static void main(String[] args) {
      Map&lt;String, Integer&gt; meineMap = new HashMap&lt;&gt;();
      int wert = 1;
      putSomethingInTheMap(meineMap, wert);
      System.out.println(meineMap.get("A"));
  }
  
  private static void putSomethingInTheMap(Map&lt;String, Integer&gt; myMap, int value) {
      myMap = insert(value);
  }
  
  private static Map&lt;String, Integer&gt; insert(int wert) {
      Map&lt;String, Integer&gt; map = new HashMap&lt;&gt;();
      map.put("A", wert);
      return map;
  }
  </code></pre>