// Path: common/src/main/java/io/spring/cloud/samples/brewery/common/model/Ingredient.java
// @Data
// public class Ingredient {
//     private IngredientType type;
//     private Integer quantity;
// 
//     public Ingredient(IngredientType type, Integer quantity) {
//         this.type = type;
//         this.quantity = quantity;
//     }
// 
//     public Ingredient() {
//     }
// }
// 
// Path: common/src/main/java/io/spring/cloud/samples/brewery/common/model/IngredientType.java
// public enum IngredientType {
//     MALT, WATER, HOP, YEAST
// }
// 
// Path: common/src/main/java/io/spring/cloud/samples/brewery/common/model/Ingredients.java
// @ToString
// public class Ingredients {
// 
//     public Ingredients() {
//     }
// 
//     public Ingredients(Iterable<Ingredient> ingredients) {
//         this.ingredients = Lists.newArrayList(ingredients);
//     }
// 
//     public List<Ingredient> ingredients = Lists.newArrayList();
// 
// }


import io.spring.cloud.samples.brewery.common.model.Ingredient;
import io.spring.cloud.samples.brewery.common.model.IngredientType;
import io.spring.cloud.samples.brewery.common.model.Ingredients;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
package io.spring.cloud.samples.brewery.aggregating;



@Service
class IngredientWarehouse {

// Path: common/src/main/java/io/spring/cloud/samples/brewery/common/model/Ingredient.java
// @Data
// public class Ingredient {
//     private IngredientType type;
//     private Integer quantity;
// 
//     public Ingredient(IngredientType type, Integer quantity) {
//         this.type = type;
//         this.quantity = quantity;
//     }
// 
//     public Ingredient() {
//     }
// }
// 
// Path: common/src/main/java/io/spring/cloud/samples/brewery/common/model/IngredientType.java
// public enum IngredientType {
//     MALT, WATER, HOP, YEAST
// }
// 
// Path: common/src/main/java/io/spring/cloud/samples/brewery/common/model/Ingredients.java
// @ToString
// public class Ingredients {
// 
//     public Ingredients() {
//     }
// 
//     public Ingredients(Iterable<Ingredient> ingredients) {
//         this.ingredients = Lists.newArrayList(ingredients);
//     }
// 
//     public List<Ingredient> ingredients = Lists.newArrayList();
// 
// }


// Path: brewing/src/main/java/io/spring/cloud/samples/brewery/aggregating/IngredientWarehouse.java
import io.spring.cloud.samples.brewery.common.model.Ingredient;
import io.spring.cloud.samples.brewery.common.model.IngredientType;
import io.spring.cloud.samples.brewery.common.model.Ingredients;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

package io.spring.cloud.samples.brewery.aggregating;



@Service
class IngredientWarehouse {

    private static final Map<IngredientType, Integer> DATABASE = new ConcurrentHashMap<>();