according to a product list with these example values
new Product("A", new Stock(5));
new Product("B", new Stock(1));
new Product("A", new Stock(1));
I would like to filter the list of duplicate objects and if there is a duplicate object. I subtract the values from it in the list.
//list after filter
Product A = 4 stock
B = 1 stock
is it possible to do this with stream?