MultipleLiveSearchSelectionHandler implements LiveSearchSelectionHandler<TYPE> { @Override public void clearSelection() { if(!selectedItems.isEmpty()) { selectedItems.forEach(LiveSearchSelectorItem::reset); selectedItems.clear(); 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 testClearSelection() { LiveSearchSelectorItem firstItem = createItem("a"); handler.registerItem(firstItem); LiveSearchSelectorItem secondItem = createItem("b"); handler.registerItem(secondItem); LiveSearchSelectorItem thirdItem = createItem("c"); handler.registerItem(thirdItem); LiveSearchSelectorItem fourthItem = createItem("d"); handler.registerItem(fourthItem); handler.selectKey("a"); handler.selectKey("b"); handler.selectKey("c"); handler.selectKey("d"); assertEquals(4, handler.getSelectedValues().size()); assertEquals("a, b, c & d", handler.getDropDownMenuHeader()); handler.clearSelection(); assertEquals(0, handler.getSelectedValues().size()); assertEquals(null, handler.getDropDownMenuHeader()); }