}
}
private void addOwners(Union node, List<Owned<Union>> ownedJoins) {
if (ownedJoins.size() == 1) {
SignedConnection o = ownedJoins.get(0).getOwner();
if (o != null) {
// every element is used by the same owner
node.replaceWith(new OwnedTupleExpr(o, node.clone()));
}
}
else {
Union replacement = new Union();
for (Owned<Union> e : ownedJoins) {
SignedConnection o = e.getOwner();
Union union = e.getOperation();
if (o == null) {
// multiple owners
for (TupleExpr arg : union.getArgs()) {
replacement.addArg(arg.clone());