static boolean matchValue(FacesContext ctx,
                              UIComponent component,
                              Object value,
                              Iterator<SelectItem> items,
                              Converter converter) {

        while (items.hasNext()) {
            SelectItem item = items.next();
            if (item instanceof SelectItemGroup) {
                SelectItem subitems[] =
                      ((SelectItemGroup) item).getSelectItems();
                if ((subitems != null) && (subitems.length > 0)) {
                    if (matchValue(ctx, component, value, new ArrayIterator(subitems), converter)) {
                        return (true);
                    }
                }
            } else {
                Object compareValue = null;
                
                try {
                    compareValue = doConversion(ctx, component, item, value,
                        converter);
                } catch (IllegalStateException ise) {
                    continue;
                }
                
                if (null == compareValue && null == value) {
                    return true;
                }

                if (value.equals(compareValue)) {
                    return (true);
                }
            }
        }
        return (false);

    }