var jsonArray = """
[
{
"prefix": "for",
"body": [
"for(int i=0; i<count; i++) {",
"}" \s
],
"description": "for loop",
"length": 1
},
{
"prefix": "foreach",
"body": [
"for(Object obj: arr) {",
"}" \s
],
"description": "foreach loop",
"length": 1
},
]
""";
var snippetsListType = new TypeToken<ArrayList<Snippet>>(){}.getType();
var snippets = new Gson().fromJson(jsonArray, snippetsListType);