@Test
public void testLoad_optionalWithTypeFlag() {

  String ingredients =
      String.join(
          "\n",
          "domain: 'test'",
          "ingredients:",
          "  - name: 'fooIngredient'",
          "    keyed: true",
          "    optionals:",
          "      - name: 'optionalField'",
          "        type: 'flag'");
  Cookbook cookbook = loader.load(toStream(ingredients));
  assertEquals("optionalField", cookbook.getIngredients().get(0).getOptionals().get(0).getName());
  assertEquals("flag", cookbook.getIngredients().get(0).getOptionals().get(0).getType());
}