I have the following list of strings
List<String> product_a= Arrays.asList("Product A", "Category A", "Price");
List<String> product_b= Arrays.asList("Product A", "Category A", "Price");
List<String> product_c= Arrays.asList("Product B", "Category B", "Price");
List<String> product_d = Arrays.asList("Product C", "Category C", "Price");
Then, I put them in another list
List<List<String>> products = new ArrayList<>();
products.add(product_a);
products.add(product_b);
products.add(product_c);
products.add(product_d);
Using streams, Collectors.groupingBy, Collectors.counting, how can I get the following output? is it possible?
Product A - 2
Product B - 1
Product C - 1
In advance, thank you for your help.
Multiset.