private static int mostSevereErrorCode(Reply reply) {
        return reply.getErrors().mapToInt(Error::getCode).max()
                .orElseThrow(() -> new IllegalArgumentException(reply + " has no errors"));
    }
Encapsulated logic for merging replies from 1-n related DocumentProtocol messages.
For internal use only. Not multithread safe.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/ReplyMerger.java