title: How to keep fields sequence in Gson serialization
body: <p>Seems like <code>Gson.toJson(Object object)</code> generates JSON code with randomly spread fields of the object. Is there way to fix fields order somehow?</p>
  <pre><code>public class Foo {
      public String bar;
      public String baz;
      public Foo( String bar, String baz ) {
          this.bar = bar;
          this.baz = baz;
      }
  }
  Gson gson = new Gson();
  String jsonRequest = gson.toJson(new Foo(&quot;bar&quot;,&quot;baz&quot;));
  </code></pre>
  <p>The string jsonRequest can be:</p>
  <ul>
  <li><code>{ &quot;bar&quot;:&quot;bar&quot;, &quot;baz&quot;:&quot;baz&quot; }</code> (correct)</li>
  <li><code>{ &quot;baz&quot;:&quot;baz&quot;, &quot;bar&quot;:&quot;bar&quot; }</code> (wrong sequence)</li>
  </ul>