class AbstractListBoxFieldRenderer extends SelectorFieldRenderer<FIELD, OPTION, TYPE> implements RequiresValueConverter {

    @Override
    protected void refreshInput(Map<TYPE, String> optionsValues,
                                TYPE selectedValue) {
        List<TYPE> values = optionsValues.keySet().stream().collect(Collectors.toList());

        if (field.getAddEmptyOption()) {
            if (!values.contains(null)) {
                values.add(0,
                           null);
                optionsValues.put(null,
                                  translationService.getTranslation(FormRenderingConstants.ListBoxFieldRendererEmptyOptionText));
            } else {
                Collections.swap(values,
                                 values.indexOf(null),
                                 0);
            }
        }

        if (widgetList.getValue() == null && optionsValues.containsKey(selectedValue)) {
            widgetList.setValue(selectedValue);
        }

        optionsRenderer.setValues(optionsValues);

        widgetList.setAcceptableValues(values);
    }

    public  AbstractListBoxFieldRenderer(TranslationService translationService);

}