@Test public void testAddToStock() { testStock.addToStock(mockMovie); testStock.addToStock(mockMovie); assertEquals(2, testStock.getInStock(mockMovie.getTitle())); }
public int addToStock(Movie movie) { Integer i = stock.get(movie.getTitle()); int inStock = (i == null) ? 0 : i; stock.put(movie.getTitle(), ++inStock); return inStock; }
Stock { public int addToStock(Movie movie) { Integer i = stock.get(movie.getTitle()); int inStock = (i == null) ? 0 : i; stock.put(movie.getTitle(), ++inStock); return inStock; } }
Stock { public int addToStock(Movie movie) { Integer i = stock.get(movie.getTitle()); int inStock = (i == null) ? 0 : i; stock.put(movie.getTitle(), ++inStock); return inStock; }  }
Stock { public int addToStock(Movie movie) { Integer i = stock.get(movie.getTitle()); int inStock = (i == null) ? 0 : i; stock.put(movie.getTitle(), ++inStock); return inStock; }  int addToStock(Movie movie); int removeFromStock(Movie movie); int getInStock(String title); void removeFromStock(String title); void addLowStockListener(LowStockListener l); void removeLowStockListener(LowStockListener l); }
Stock { public int addToStock(Movie movie) { Integer i = stock.get(movie.getTitle()); int inStock = (i == null) ? 0 : i; stock.put(movie.getTitle(), ++inStock); return inStock; }  int addToStock(Movie movie); int removeFromStock(Movie movie); int getInStock(String title); void removeFromStock(String title); void addLowStockListener(LowStockListener l); void removeLowStockListener(LowStockListener l);  }