I have the following list and map:
final List<Product> productList = productService.findAll(uuidList);
Map<UUID, Product> productMap = new HashMap<>();
I want to add the element pairs to the map as shown below:
productList.stream().map(product -> {
productMap.put(product.getUuid(), product);
});
However, the last line throws "Missing return statement" error. When I update as shown below, it has gone, but this time return is useless. So, how should I add UUID and Product pair to my map?