ElementPresenter implements ElementView.Presenter<E> { @Override public void toggleEditingStatus(boolean toDisable) { elementViewList.forEach(element -> { element.getEditItemButton().setDisabled(toDisable); element.getDeleteItemButton().setDisabled(toDisable); }); }  @Override void setCollectionEditorPresenter(CollectionView.Presenter collectionEditorPresenter); @Override void onToggleRowExpansion(boolean isShown); @Override void updateCommonToggleStatus(boolean isShown); @Override void remove(); @Override void toggleEditingStatus(boolean toDisable);  }
@Test public void toggleEditItemButtonStatusToDisableTrue() { elementPresenter.toggleEditingStatus(true); elementViewListLocal.forEach(elementViewMock -> { verify(elementViewMock, times(1)).getEditItemButton(); verify(elementViewMock, times(1)).getDeleteItemButton(); }); verify(editItemButtonMock, times(2)).setDisabled(true); verify(deleteItemButtonMock, times(2)).setDisabled(true); }
@Test public void toggleEditItemButtonStatusToDisableFalse() { elementPresenter.toggleEditingStatus(false); elementViewListLocal.forEach(elementViewMock -> { verify(elementViewMock, times(1)).getEditItemButton(); verify(elementViewMock, times(1)).getDeleteItemButton(); }); verify(editItemButtonMock, times(2)).setDisabled(false); verify(deleteItemButtonMock, times(2)).setDisabled(false); }