private Converter getConverterForValue(FacesContext context, UIComponent component) {
    Converter converter = ((ValueHolder) component).getConverter();
    if (converter == null) {
      ValueExpression expression = component.getValueExpression("value");

      if (expression != null) {
        Class<?> containerClass =
            ServiceTracker.getService(context, GenericsIntrospectionService.class)
                .getContainerClass(context, expression);

        converter = InputUtils.getConverterForType(context, containerClass);
      }
    }
    return converter;
  }