public static void merge(RoutingContext ctx, Set<Integer> mask) {
        List<Reply> replies = new LinkedList<>();
        for (RoutingNodeIterator it = ctx.getChildIterator();
             it.isValid(); it.next()) {
            Reply ref = it.getReplyRef();
            replies.add(ref);
        }
        Tuple2<Integer, Reply> tuple = merge(replies, mask);
        if (tuple.first != null) {
            ctx.getChildIterator().skip(tuple.first).removeReply();
        }
        ctx.setReply(tuple.second);
    }
This method implements the common way to merge document replies for whatever routing policy. In case of an error
in any of the replies, it will prepare an EmptyReply() and add all errors to it. If there are no errors, this
method will use the first reply in the list and transfer whatever feed answers might exist in the replies to it.

@param ctx  the context whose children to merge
@param mask the indexes of the children to skip
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocol.java