code: public static BaseMenuComponent findMenu(BaseComponent parent, String label, BaseComponent insertBefore) {
  
          for (BaseMenuComponent child : parent.getChildren(BaseMenuComponent.class)) {
              if (label.equalsIgnoreCase(child.getLabel())) {
                  return child;
              }
          }
  
          BaseMenuComponent cmp = createMenuOrMenuitem(parent);
          cmp.setLabel(label);
          parent.addChild(cmp, insertBefore);
          return cmp;
      }
docs: Returns the menu with the specified label, or creates one if it does not exist.
  
  @param parent The parent component under which to search. May be a Toolbar or a Menupopup
  component.
  @param label Label of menu to search.
  @param insertBefore If not null, the new menu is inserted before this one. If null, the menu
  is appended.
  @return Menu or menu item with the specified label.