public void testSelectionHeader() {
DataTable<Whatever> table = new DataTable<Whatever>(100, "200px");
KeyProvider keyProvider = new KeyProvider();
SwitchableSelectionModel<Whatever> selectionModel = new SwitchableSelectionModel<Whatever>(keyProvider, SelectionType.MULTI);
SelectionHeader header = table.new SelectionHeader(table, selectionModel);
assertTrue(header.getCell() instanceof CheckboxCell);
assertSame(table, header.table);
assertSame(selectionModel, header.selectionModel);
assertEquals(SelectionType.MULTI, header.selectionModel.getSelectionType());
assertFalse(header.getValue());
assertTrue(((CheckboxCell) header.getCell()).isEnabled());
header.setSelectionType(SelectionType.SINGLE);
assertEquals(SelectionType.SINGLE, header.selectionModel.getSelectionType());
assertFalse(((CheckboxCell) header.getCell()).isEnabled());
header.setSelectionType(SelectionType.MULTI);
assertEquals(SelectionType.MULTI, header.selectionModel.getSelectionType());
assertTrue(((CheckboxCell) header.getCell()).isEnabled());
}