*
* @param c an existing collection. If the elements are JsonElements, they will be added. Otherwise, primitive will be called on them.
* @return json array with the collection elements in it
*/
public static JsonSet set(Iterable<?> c) {
JsonSet jjArray = new JsonSet();
if(c instanceof JsonElement) {
jjArray.add((JsonArray)c);
} else {
for (Object o : c) {
if (o instanceof JsonElement) {
jjArray.add((JsonElement) o);
} else {
jjArray.add(primitive(o));
}
}
}
return jjArray;
}