KeyValueElementPresenter extends ElementPresenter<KeyValueElementView> implements KeyValueElementView.Presenter { @Override public void onEditItem(KeyValueElementView keyValueElementView) { if (!keyValueElementView.isShown()) { onToggleRowExpansion(keyValueElementView, false); } List<String> keyValueIds = getKeyValueIds( keyValueElementView.getItemId()); keyValueIds.forEach(id -> propertyPresenter.editProperties(id)); keyValueElementView.getSaveChange().getStyle().setDisplay(Style.Display.INLINE); toggleEditingStatus(true); collectionEditorPresenter.toggleEditingStatus(true); }  @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 onEditItemNotShown() { doReturn(false).when(elementView1Mock).isShown(); elementPresenter.onEditItem(elementView1Mock); verify(propertyPresenterMock, times(2)).editProperties(anyString()); verify(styleMock, times(1)).setDisplay(Style.Display.INLINE); verify(collectionPresenterMock, times(1)).toggleEditingStatus(eq(true)); }