import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonValue;
...
JsonObject object = Json.createObjectBuilder().build();
JsonArray array = Json.createArrayBuilder().build();
JsonArray tweets = getTweets();
for (JsonValue tweet : tweets) {
object = (JsonObject) tweet;
array.add(object);
}
return array;
I get this exception:
java.lang.UnsupportedOperationException
I also took a look at the java documentation but it did not help. .