class CookbookUtils {

  public static boolean enumHasValue(Cookbook cookbook, String enumName, String value) {
    return CookbookUtils.isEnumType(cookbook, enumName)
        && cookbook.getEnums().stream()
            .filter(e -> e.getName().equals(enumName))
            .collect(Collectors.toList())
            .get(0)
            .getValues()
            .contains(value);
  }

}