Don't mix Gson and JsonObject,
1) if you need {"test":["aaa","bbb","ccc"]} using GSON you should define
public class MyJsonContainer {
List<String> test = new ArrayList<String>();
...
// getter and setter
}
and use
List<String> exampleList = new ArrayList<String>();
exampleList.add("aaa");
exampleList.add("bbb");
exampleList.add("ccc");
MyJsonContainer jsonContainer = new MyJsonContainer();
jsonContainer.setTest(exampleList);
String json = gson.toJson(jsonContainer); // this json has {"test":["aaa","bbb","ccc"]}
2) if you need {"test":["aaa","bbb","ccc"]} using JsonObject you should just add
List<String> exampleList = new ArrayList<String>();
exampleList.add("aaa");
exampleList.add("bbb");
exampleList.add("ccc");
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("test", exampleList);
But never try to mix Gson and JsonObject, because jsonObject.addProperty("test", text) does not allowed to add text as json and allways escaped this text.