Consolidate multiple java arraylists into a single json object
===

I've got 2 java Lists (Arraylists) of Floats, ListA and ListB of x and y coordinated which look like:

    ListA = 10.1, 17.3, 30.0
    ListB = 1.4, -14.7, 5.1

 and I want to create a json object such that the two arraylists are consolidated into a single json object as:

    [ { label: "A", data: [ [10.1, 1.4], [17.3, -14.7], [30.0, 5.1] ] }]

that I can plot using  [flot][1].

I've been looking at the [Gson lib][2] but I can't see a concise way to do this - is there a simpler way than setting up loops for each key and manually appending "[ { ..." etc ?

Thanks!


  [1]: http://code.google.com/p/flot/
  [2]: https://sites.google.com/site/gson/gson-user-guide/