ProductPresenter extends Presenter<ProductPresenter.MyView, ProductPresenter.MyProxy> implements ProductPresenterUiHandlers { @Override public void onAddToCartButtonClicked(int quantity) { ShoppingCartItem shoppingCartItem = new ShoppingCartItem(currentProduct.get(), quantity); currentOrder.addItem(shoppingCartItem); } @Inject  ProductPresenter(
            EventBus eventBus,
            MyView view,
            MyProxy proxy,
            SharePanelPresenter sharePanel,
            CurrentOrder currentOrder,
            CurrentProduct currentProduct,
            ResourceDelegate<ProductResource> productDelegate); @Override void onShareButtonClicked(); @Override void prepareFromRequest(PlaceRequest request); @Override void onAddToCartButtonClicked(int quantity);  }
@Test public void onAddToCartButtonClicked_addItemToCurrentOrder() { int itemQuantity = 32; ProductDto productToAdd = new ProductDto.Builder().build(); given(currentProduct.get()).willReturn(productToAdd); presenter.onAddToCartButtonClicked(itemQuantity); ArgumentCaptor<ShoppingCartItem> captor = ArgumentCaptor.forClass(ShoppingCartItem.class); verify(currentOrder).addItem(captor.capture()); ShoppingCartItem addedItem = captor.getValue(); assertThat(addedItem.getProductDto()).isEqualTo(productToAdd); assertThat(addedItem.getQuantity()).isEqualTo(itemQuantity); }