SyntaxFix
Write A Post
Hire A Developer
Questions
Using a supposed name property as the map key:
for (Product p: productList) { s.put(p.getName(), p); }