class HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> {

    @SuppressWarnings("unchecked")
    @Override
    protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) {
        Object component = componentWrapper.getComponent();
        if (component instanceof ComboBox<?>) {
            boolean hasNullItem = items.removeIf(i -> i == null);
            ((ComboBox<Object>)component).setEmptySelectionAllowed(hasNullItem);
        } else if (component instanceof NativeSelect<?>) {
            boolean hasNullItem = items.removeIf(i -> i == null);
            ((NativeSelect<Object>)component).setEmptySelectionAllowed(hasNullItem);
        }
    }

    public  HasItemsAvailableValuesAspectDefinition(AvailableValuesType availableValuesType);

}