title: Gson calls my JSON "map". How can I change the element/root name?
body: <p>I'm using Java to print a JSON object (containing several objects). I would like to print that object in JSON style.
  So I use Gson to make a String out of it, which is then printed. But it always prints &quot;map&quot; as first element/root! Could anyone help with that, please?
  It prints it like that:</p>
  <pre><code>{
     &quot;map&quot; : {
        &quot;swimmers&quot; : {
           &quot;Gold&quot; : &quot;Joan&quot;,
           &quot;Silver&quot; : &quot;Mik&quot;,
           &quot;Bronze&quot; : &quot;Vy&quot;
         }, {
         &quot;runners&quot; : {
           &quot;Gold&quot; : &quot;Ann&quot;,
           &quot;Silver&quot; : &quot;X&quot;
           &quot;Bronze&quot; : &quot;Y&quot;
         }
     }
  }
  </code></pre>
  <p>Where does the 'map' come from? Is it possible to change?
  I would like there not be a 'map' - I actually tried it to be called 'January', which did not work. This solution would be optimal:</p>
  <pre><code>{
     &quot;January&quot; : {
        &quot;athletes 1&quot; : {
           &quot;Gold&quot; : &quot;Joan&quot;,
           &quot;Silver&quot; : &quot;Mik&quot;,
           &quot;Bronze&quot; : &quot;Vy&quot;
         }, {
         &quot;athletes 2&quot; : {
           &quot;Gold&quot; : &quot;Ann&quot;,
           &quot;Silver&quot; : &quot;X&quot;
           &quot;Bronze&quot; : &quot;Y&quot;
         }
     }
  }
  </code></pre>
  <p>This is my code:</p>
  <pre><code>JSONObject myObject = new JSONObject();
  
  for (int i = 0; i &lt; results.length(); i++) {
        
     // ...cut out code here where I received gold, silver and bronze...
         
     Athlete currentAthlete = new Athlete(gold, silver, bronze);
     myObject.put(&quot;athletes &quot;+i, currentAthlete);
     }
  
  Gson gson = new Gson();
  jsonString = gson.toJson(myObject);
  System.out.println(jsonString);
  </code></pre>