code: public static Set getSubmittedValuesAsSet(FacesContext context,
              UIComponent component, Converter converter,
              UISelectMany uiSelectMany)
      {
          Object submittedValues = uiSelectMany.getSubmittedValue();
          if (submittedValues == null)
          {
              return null;
          }
  
          if (converter != null)
          {
              converter = new PassThroughAsStringConverter(converter);
          }
  
          return internalSubmittedOrSelectedValuesAsSet(context, component,
                  converter, uiSelectMany, submittedValues, false);
      }
docs: Convenient utility method that returns the currently submitted values of
  a UISelectMany component as a Set, of which the contains method can then be
  easily used to determine if a select item is currently selected.
  Calling the contains method of this Set with the renderable (String converted) item value
  as argument returns true if this item is selected.
  @param uiSelectMany
  @return Set containing all currently selected values