void () { myAnyOfGroup.add(mySourceNode); for (Operation op : myChildOperations) { if (!op.myState.equals(SchemaResolveState.normal)) continue; final List<JsonSchemaObject> mergedAny = andGroups(op.myAnyOfGroup, myAnyOfGroup); final List<List<JsonSchemaObject>> mergedExclusive = new ArrayList<>(op.myAnyOfGroup.size() * maxSize(myOneOfGroup) + myAnyOfGroup.size() * maxSize(op.myOneOfGroup) + maxSize(myOneOfGroup) * maxSize(op.myOneOfGroup)); for (List<JsonSchemaObject> objects : myOneOfGroup) { mergedExclusive.add(andGroups(op.myAnyOfGroup, objects)); } for (List<JsonSchemaObject> objects : op.myOneOfGroup) { mergedExclusive.add(andGroups(objects, myAnyOfGroup)); } for (List<JsonSchemaObject> group : op.myOneOfGroup) { for (List<JsonSchemaObject> otherGroup : myOneOfGroup) { mergedExclusive.add(andGroups(group, otherGroup)); } } myAnyOfGroup.clear(); myOneOfGroup.clear(); myAnyOfGroup.addAll(mergedAny); myOneOfGroup.addAll(mergedExclusive); } }