class CookbookLoader {

  public Cookbook load(InputStream ingredients) {
    ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    Cookbook cookbook = null;
    try {
      cookbook = mapper.readValue(ingredients, Cookbook.class);
    } catch (IOException e) {
      throw new RuntimeException("could not load recipe cookbook from input stream", e);
    }
    validate(cookbook);
    return cookbook;
  }

}