Here you can find the source of addAll(JsonObjectBuilder a, JsonObjectBuilder b)
public static JsonObjectBuilder addAll(JsonObjectBuilder a, JsonObjectBuilder b)
//package com.java2s; //License from project: Apache License import java.util.Objects; import javax.json.JsonArray; import javax.json.JsonArrayBuilder; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; public class Main { public static JsonObjectBuilder addAll(JsonObjectBuilder a, JsonObjectBuilder b) { Objects.requireNonNull(a); Objects.requireNonNull(b); return addAll(a, b.build()); }// w w w . ja v a2 s . com public static JsonObjectBuilder addAll(JsonObjectBuilder a, JsonObject b) { Objects.requireNonNull(a); Objects.requireNonNull(b); b.forEach(a::add); return a; } public static JsonArrayBuilder addAll(JsonArrayBuilder a, JsonArrayBuilder b) { Objects.requireNonNull(a); Objects.requireNonNull(b); return addAll(a, b.build()); } public static JsonArrayBuilder addAll(JsonArrayBuilder a, JsonArray b) { Objects.requireNonNull(a); Objects.requireNonNull(b); b.forEach(a::add); return a; } }