### Question:
MapSelectionControl extends AbstractCanvasHandlerControl<H> implements SelectionControl<H, Element>,
                   CanvasRegistrationControl<H, Element> { @Override public SelectionControl<H, Element> clearSelection() { return clearSelection(true); } MapSelectionControl(final Consumer<CanvasSelectionEvent> selectionEventConsumer,
                        final Consumer<CanvasClearSelectionEvent> clearSelectionEventConsumer); static MapSelectionControl<H> build(final Consumer<CanvasSelectionEvent> selectionEventConsumer,
                                                                                 final Consumer<CanvasClearSelectionEvent> clearSelectionEventConsumer); @Override void clear(); @Override void register(final Element element); @Override void deregister(final Element element); @Override SelectionControl<H, Element> select(final String uuid); @Override SelectionControl<H, Element> deselect(final String uuid); @Override boolean isSelected(final Element element); @Override Collection<String> getSelectedItems(); @Override SelectionControl<H, Element> clearSelection(); @Override Optional<Object> getSelectedItemDefinition(); boolean isReadonly(); void setReadonly(boolean readonly); SelectionControl<H, Element> select(final Collection<String> uuids); SelectionControl<H, Element> deselect(final Collection<String> uuids); boolean isSelected(final String uuid); void onShapeRemoved(final CanvasShapeRemovedEvent shapeRemovedEvent); void onCanvasElementSelected(final CanvasSelectionEvent event); void onCanvasClearSelection(final CanvasClearSelectionEvent event); AbstractCanvasHandler getCanvasHandler(); Predicate<String> itemsRegistered(); AbstractCanvas getCanvas();  }### Answer:
@Test public void testClearSelection() { tested.init(canvasHandler); tested.register(element); tested.select(element.getUUID()); tested.clearSelection(); assertTrue(tested.getSelectedItems().isEmpty()); verify(shape, times(1)).applyState(eq(ShapeState.SELECTED)); verify(shape, times(1)).applyState(eq(ShapeState.NONE)); verify(shape, never()).applyState(eq(ShapeState.INVALID)); verify(shape, never()).applyState(eq(ShapeState.HIGHLIGHT)); verify(clearSelectionEvent, times(1)).fire(any(CanvasClearSelectionEvent.class)); }