title: Serialize objects with Gson into arbitrary JSON arrays without getting warnings
body: <p>I need to serialize an object like this:</p>
  
  <pre><code>class A {
      int a = 1;
      String b = "hello";
      boolean isDog = false;
  }
  </code></pre>
  
  <p>into JSON array like this:</p>
  
  <pre><code>[1,"hello",false]
  </code></pre>
  
  <p>I know one (wrong) way to do this: create an untyped Collection out of object's fields and then Gson it:</p>
  
  <pre><code>class A {
      // ...
      Collection forGson() {
          ArrayList col = new ArrayList();
          col.add(a);
          col.add(b);
          col.add(c);
          return col;
      } 
  }
  new Gson().toJson(new A().forGson());
  </code></pre>
  
  <p>But it produces a lot of warnings because of untyped collections usage. So is there any way to serialize objects into an array of arbitrary types without getting any warnings?</p>