ItemElementPresenter extends ElementPresenter<ItemElementView> implements ItemElementView.Presenter { @Override public void onDeleteItem(ItemElementView itemElementView) { propertyPresenter.deleteProperties(itemElementView.getItemId()); itemIdExpandablePropertiesMap.get(itemElementView.getItemId()).forEach(expandablePropertyName -> propertyPresenter.deleteProperties(expandablePropertyName)); itemElementView.getItemContainer().removeFromParent(); elementViewList.remove(itemElementView); collectionEditorPresenter.toggleEditingStatus(false); }  @Override LIElement getItemContainer(String itemId, Map<String, String> simplePropertiesMap, Map<String, Map<String, String>> expandablePropertiesValues); @Override void onToggleRowExpansion(ItemElementView itemElementView, boolean isShown); @Override void onEditItem(ItemElementView itemElementView); @Override void onStopEditingItem(ItemElementView itemElementView); @Override void updateItem(ItemElementView itemElementView); @Override void onDeleteItem(ItemElementView itemElementView); @Override Map<String, Map<String, String>> getSimpleItemsProperties(); @Override Map<String, Map<String, Map<String, String>>> getExpandableItemsProperties();  }
@Test public void onDeleteItem() { elementPresenter.onDeleteItem(elementView1Mock); verify(propertyPresenterMock, times(1)).deleteProperties(eq(ELEMENT1_ID)); verify(itemContainerMock, times(1)).removeFromParent(); assertFalse(elementViewListLocal.contains(elementView1Mock)); verify(collectionPresenterMock, times(1)).toggleEditingStatus(eq(false)); }