@Test public void getSelectedItem() { selectionModel.setSelectedItem(PERSON_B); Assert.assertEquals(PERSON_B, selectionModel.getSelectedItem().get()); selectionModel.deselect(PERSON_B); Assert.assertFalse(selectionModel.getSelectedItem().isPresent()); }
@Test public void selectDeselect() { selectionModel.select(PERSON_B); selectionModel.deselect(PERSON_B); assertFalse(selectionModel.getSelectedItem().isPresent()); assertFalse(selectionModel.isSelected(PERSON_A)); assertFalse(selectionModel.isSelected(PERSON_B)); assertFalse(selectionModel.isSelected(PERSON_C)); assertFalse(selectionModel.getSelectedItem().isPresent()); assertEquals(Arrays.asList(PERSON_B, null), selectionChanges); }