File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public float getPrice()
5656 */
5757 public List <Product > getProductsInMenu ()
5858 {
59- return Collections . unmodifiableList (new ArrayList <Product >(productsMenu .keySet ()));
59+ return List . copyOf (new ArrayList <Product >(productsMenu .keySet ()));
6060 }
6161 /**
6262 * Returns how much of a product is contained in this menu.
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public BigDecimal totalCost()
9191 */
9292 public List <Product > getProducts ()
9393 {
94- return Collections . unmodifiableList (new ArrayList <Product >(basket .keySet ()));
94+ return List . copyOf (new ArrayList <Product >(basket .keySet ()));
9595 }
9696
9797 /**
@@ -101,7 +101,7 @@ public List<Product> getProducts()
101101 */
102102 public Map <Product ,Integer > getBasket ()
103103 {
104- return Collections . unmodifiableMap (basket );
104+ return Map . copyOf (basket );
105105 }
106106
107107 /**
You can’t perform that action at this time.
0 commit comments