get SelectionMode from Grid

Hello
how may I get the SelectionMode from a Grid, in order to see if it is MULTI or SINGLE?

Vaadin 8

import com.vaadin.ui.components.grid.MultiSelectionModel;
import com.vaadin.ui.components.grid.SingleSelectionModel;
if (grid.getSelectionModel() instanceof SingleSelectionModel) 
// do something
if (grid.getSelectionModel() instanceof MultiSelectionModel)
// do something