if (required && selected.size == 1) return;
selected.remove(item);
lastSelected = null;
} else {
boolean modified = false;
<BUG>if (!multiple || (!toggle && !UIUtils.ctrl())) {
modified = selected.size > 0;</BUG>
selected.clear();
}
if (!selected.add(item) && !modified) return;

if (required && selected.size == 1) return;
selected.remove(item);
lastSelected = null;
} else {
boolean modified = false;
if (!multiple || (!toggle && !UIUtils.ctrl())) {
if (selected.size == 1 && selected.contains(item)) return;
modified = selected.size > 0;
selected.clear();
}
if (!selected.add(item) && !modified) return;
