@Test public void addOneTest() { Product p = new Product(tracker).setProductId("pdtID"); p = productsTracker.add(p); productsCart.add(p); assertEquals(1, tracker.getBusinessObjects().size()); assertEquals(1, tracker.Cart().getProductsList().size()); }
public Product add(Product product) { if (cart != null) { cart.getProductsList().add(product); } else { tracker.getBusinessObjects().put(product.getId(), product); } return product; }
Products extends Helper { public Product add(Product product) { if (cart != null) { cart.getProductsList().add(product); } else { tracker.getBusinessObjects().put(product.getId(), product); } return product; } }
Products extends Helper { public Product add(Product product) { if (cart != null) { cart.getProductsList().add(product); } else { tracker.getBusinessObjects().put(product.getId(), product); } return product; } Products(Tracker tracker);   Products(Cart cart); }
Products extends Helper { public Product add(Product product) { if (cart != null) { cart.getProductsList().add(product); } else { tracker.getBusinessObjects().put(product.getId(), product); } return product; } Products(Tracker tracker);   Products(Cart cart); Product add(Product product); Product add(String productId); Product add(String productId, String category1); Product add(String productId, String category1, String category2); Product add(String productId, String category1, String category2, String category3); Product add(String productId, String category1, String category2, String category3, String category4); Product add(String productId, String category1, String category2, String category3, String category4, String category5); Product add(String productId, String category1, String category2, String category3, String category4, String category5, String category6); void remove(String productId); void removeAll(); void sendViews(); }
Products extends Helper { public Product add(Product product) { if (cart != null) { cart.getProductsList().add(product); } else { tracker.getBusinessObjects().put(product.getId(), product); } return product; } Products(Tracker tracker);   Products(Cart cart); Product add(Product product); Product add(String productId); Product add(String productId, String category1); Product add(String productId, String category1, String category2); Product add(String productId, String category1, String category2, String category3); Product add(String productId, String category1, String category2, String category3, String category4); Product add(String productId, String category1, String category2, String category3, String category4, String category5); Product add(String productId, String category1, String category2, String category3, String category4, String category5, String category6); void remove(String productId); void removeAll(); void sendViews();  }