KeyValueElementPresenter extends ElementPresenter<KeyValueElementView> implements KeyValueElementView.Presenter { @Override public void onDeleteItem(KeyValueElementView keyValueElementView) { List<String> keyValueIds = getKeyValueIds( keyValueElementView.getItemId()); keyValueIds.forEach(id -> propertyPresenter.deleteProperties(id)); keyValueElementView.getItemContainer().removeFromParent(); elementViewList.remove(keyValueElementView); toggleEditingStatus(false); collectionEditorPresenter.toggleEditingStatus(false); }  @Override LIElement getKeyValueContainer(String itemId, Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues); @Override void onToggleRowExpansion(KeyValueElementView keyValueElementView, boolean isShown); @Override void onEditItem(KeyValueElementView keyValueElementView); @Override void onStopEditingItem(KeyValueElementView keyValueElementView); @Override void onDeleteItem(KeyValueElementView keyValueElementView); @Override void updateItem(KeyValueElementView keyValueElementView); @Override Map<Map<String, String>, Map<String, String>> getItemsProperties();  }
@Test public void onDeleteItem() { elementPresenter.onDeleteItem(elementView1Mock); verify(propertyPresenterMock, times(1)).deleteProperties(eq(ELEMENT1_ID + "#key")); verify(propertyPresenterMock, times(1)).deleteProperties(eq(ELEMENT1_ID + "#value")); verify(itemContainerMock, times(1)).removeFromParent(); assertFalse(elementViewListLocal.contains(elementView1Mock)); verify(collectionPresenterMock, times(1)).toggleEditingStatus(eq(false)); }