title: JSON to hashmap with GSON
body: <p>I working on a project in Java and I want to put text in a HashMap using GSON,here is my JSON:  </p>
  
  <pre><code>{
  "someText": {
      "text1": "lorem ipsum",
      "text2": "ipsum lorem"
      }
  }
  </code></pre>
  
  <p>and here a piece of my code:</p>
  
  <pre><code>private static class myTexts {
      private final Map&lt;String, String&gt; someText = new HashMap&lt;String, String&gt;();
  }  
  </code></pre>
  
  <hr>
  
  <pre><code>myTexts t = this.gson.fromJson(myJsonFile, myTexts.class);
  </code></pre>
  
  <p>I have this error: <code>com.google.gson.JsonSyntaxException: duplicate key: null</code>, I've tried to find what's wrong for a while, but I can't seem to find the problem :/</p>