package tech_store; import java.util.ArrayList; public class StorageManager { private ArrayList storageProducts; public StorageManager(ArrayList products) { this.storageProducts = products; } public void addProduct(Product product) { this.storageProducts.add(product); } public ArrayList getStorage() { return this.storageProducts; } public void increaseStorage(int id, int amt) { this.getProductByID(id).increaseAmount(amt); } public Product getProductByID(int id) { for (Product product : this.storageProducts) { if (product.getID() == id) { return product; } } return new Product(-1, "", 0, 0); } }