MultipleLiveSearchSelectionHandler implements LiveSearchSelectionHandler<TYPE> { @Override public void selectItem(LiveSearchSelectorItem<TYPE> item) { LiveSearchSelectorItem<TYPE> selectedItem = selectedItems.stream() .filter(listItem -> listItem.getKey().equals(item.getKey())).findFirst() .orElse(null); if(selectedItem != null) { selectedItem.reset(); selectedItems.remove(selectedItem); } else { item.select(); selectedItems.add(item); } if(onChangeNotification != null) { onChangeNotification.execute(); } } MultipleLiveSearchSelectionHandler();  MultipleLiveSearchSelectionHandler(int maxDropDownTextItems); @Override String getDropDownMenuHeader(); @Override void registerItem(LiveSearchSelectorItem<TYPE> item); @Override void selectItem(LiveSearchSelectorItem<TYPE> item); @Override void selectKey(TYPE key); @Override void clearSelection(); List<TYPE> getSelectedValues(); void setMaxDropDownTextItems(int maxDropDownTextItems); @Override void setLiveSearchSelectionCallback(Command command); @Override boolean isMultipleSelection();  }
@Test public void testSelectItem() { doTestSelectItem(); assertEquals(1, handler.getSelectedValues().size()); assertEquals(SELECTED_ITEM_TEXT, handler.getDropDownMenuHeader()); }