### Question:
RunlistElement extends DefaultEntityBase { public boolean isCookbook() { return isRecipe() && !getRecipeName().contains("::"); } protected  RunlistElement();  RunlistElement(final String name, final String description, final int priority); @Override Integer getId(); void setId(final Integer id); @Required(value = VIRTUALMACHINE_REQUIRED) VirtualMachine getVirtualMachine(); void setVirtualMachine(final VirtualMachine virtualMachine); @Required(value = NAME_REQUIRED) @Length(min = NAME_LENGTH_MIN, max = NAME_LENGTH_MAX) @LeadingOrTrailingWhitespace(allowed = NAME_LEADING_OR_TRAILING_WHITESPACES_ALLOWED) @RunlistItem String getName(); void setName(final String name); @Required(value = DESCRIPTION_REQUIRED) @Length(min = DESCRIPTION_LENGTH_MIN, max = DESCRIPTION_LENGTH_MAX) @LeadingOrTrailingWhitespace(allowed = DESCRIPTION_LEADING_OR_TRAILING_WHITESPACES_ALLOWED) String getDescription(); void setDescription(final String description); @Required(value = PRIORITY_REQUIRED) int getPriority(); void setPriority(final int priority); boolean isCookbook(); boolean isRecipe(); boolean isRole(); String getRecipeName(); String getRoleName(); Type getType(); static final String TABLE_NAME; final static String VIRTUALMACHINE_PROPERTY; final static String NAME_PROPERTY; final static String DESCRIPTION_PROPERTY; final static String PRIORITY_PROPERTY; }### Answer:
@Test public void testIsCookBook() { RunlistElement recipe = createUniqueEntity(); recipe.setName("recipe[]"); assertFalse(recipe.isCookbook()); recipe.setName("recipe[:]"); assertTrue(recipe.isCookbook()); recipe.setName("recipe[testcookbook]"); assertTrue(recipe.isCookbook()); recipe.setName("recipe[::]"); assertFalse(recipe.isCookbook()); recipe.setName("recipe[test::recipe]"); assertFalse(recipe.isCookbook()); }