public static void setQuantity(WorldPopulation product, int quantity) {
    // Get the current cart entry
    ShoppingCartEntry curEntry = cartMap.get(product);
    // If the quantity is zero or less, remove the products
    if (quantity <= 0) {
      if (curEntry != null) removeProduct(product);
      return;
    }

    // If a current cart entry doesn't exist, create one
    if (curEntry == null) {
      curEntry = new ShoppingCartEntry(product, quantity);
      cartMap.put(product, curEntry);
      return;
    }
    // Update the quantity
    curEntry.setQuantity(quantity);
  }
 public static int getProductQuantity(WorldPopulation product) {
   // Get the current cart entry
   ShoppingCartEntry curEntry = cartMap.get(product);
   if (curEntry != null) return curEntry.getQuantity();
   return 0;
 }