class MessageList implements Serializable, Iterable<Message> {

    public Optional<Message> getMessageWithHighestSeverity() {
        return messages.stream()
                .sorted(Comparator.comparing(Message::getSeverity).reversed())
                .findFirst();
    }

    public  MessageList(@NonNull Message... messages);

}