@Override
    public List<MenuElement> getElements() {
        return elements;
    }
Base implementation for model of a programmatic menu
primefaces/src/main/java/org/primefaces/model/menu/BaseMenuModel.java