DataTable<Whatever> table = new DataTable<Whatever>(100, "200px");
KeyProvider keyProvider = new KeyProvider();
SwitchableSelectionModel<Whatever> selectionModel = new SwitchableSelectionModel<Whatever>(keyProvider, SelectionType.MULTI);
Whatever value = new Whatever();
SelectionColumn column = table.new SelectionColumn(selectionModel);
assertTrue(column.getCell() instanceof CheckboxCell);
assertFalse(column.isSortable());
assertSame(selectionModel, column.selectionModel);
assertEquals(SelectionType.MULTI, column.selectionModel.getSelectionType());
assertTrue(((CheckboxCell) column.getCell()).isEnabled());
column.setSelectionType(SelectionType.SINGLE);
assertEquals(SelectionType.SINGLE, column.selectionModel.getSelectionType());
assertTrue(((CheckboxCell) column.getCell()).isEnabled());
column.setSelectionType(SelectionType.MULTI);
assertEquals(SelectionType.MULTI, column.selectionModel.getSelectionType());
assertTrue(((CheckboxCell) column.getCell()).isEnabled());
column.selectionModel.setSelected(value, true);
assertTrue(column.getValue(value));
column.selectionModel.setSelected(value, false);
assertFalse(column.getValue(value));
}