@Override
    public void setSelected(final T item, final SelectionType selectionType, final boolean fireEvents) {
        if (item == null) {
            clear(fireEvents);

        } else {
            final boolean currentlySelected = isSelected(item);
            if (!currentlySelected || selection.size() != 1) {
                List<T> items = selection.getSelectedItems();

                // Mark changes.
                if (currentlySelected) {
                    items.stream().filter(t -> !t.equals(item)).forEach(changes::add);
                } else {
                    changes.addAll(items);
                    changes.add(item);
                }

                selection.setSelected(item);

                fireSelectionChangeEvent();
                if (fireEvents) {
                    fireChange(selectionType);
                }
            } else if (selectionType.isDoubleSelect()) {
                MultiSelectEvent.fire(handlerManager, selectionType);
            }
        }
    }
Sets the specified item as the only selected item, i.e. clears the current
selection and sets a single item selected.
stroom-core-client-widget/src/main/java/stroom/widget/util/client/MultiSelectionModelImpl.java