protected boolean shouldBeRendered(FacesContext context, MenuElement menuElement) {
        if (menuElement instanceof MenuGroup) {
            MenuGroup group = (MenuGroup) menuElement;
            return group.getElements().stream().anyMatch(me -> shouldBeRendered(context, me));
        }
        else if (menuElement instanceof Separator) {
            return false;
        }
        else {
            try {
                if (menuElement instanceof UIComponent) {
                    UIComponent component = (UIComponent) menuElement;
                    component.pushComponentToEL(context, component);
                }
                return menuElement.isRendered();
            }
            finally {
                if (menuElement instanceof UIComponent) {
                    UIComponent component = (UIComponent) menuElement;
                    component.popComponentFromEL(context);
                }
            }
        }
    }
Decode menu item not present in Faces tree but added using model attribute.
ID is in format UUID|COORDS.

@param context the FacesContext
@param component the menu component
@return true if a menu item has been decoded, otherwise false
primefaces/src/main/java/org/primefaces/renderkit/MenuItemAwareRenderer.java