public Msg getMessage(int index) {
        List<Msg> allMessages = getAllMessages();

        if (allMessages.size() > index) {
            return allMessages.get(index);
        }

        return null;
    }
Component wrapper for the PrimeFaces {@code p:messages}.
primefaces-selenium/primefaces-selenium-components/src/main/java/org/primefaces/selenium/component/Messages.java