setNullSelectionAllowed(false) for Tree in Vaadin 8

I couldn’t find how to do
setNullSelectionAllowed(
false
)
for com.vaadin.ui.Tree in Vaadin 8. Is there another way to do this in Vaadin 8?

Bump.

Answer:

setSelectionMode(SelectionMode.SINGLE);
((SingleSelectionModel<?>) getSelectionModel()).setDeselectAllowed(false);

Wow, nobody replied… Is it because nobody knew how to do it? Or because nobody cared?

In any case, not sure why Vaadin removed setNullSelectionAllowed for Tree. Now it’s only usable for single selection mode.