### Question:
RecipeBuilder { public RecipeBuilder clone(Recipe recipe) { plugin = recipe.getPlugin(); result = recipe.getResult(); ingredients = recipe.getIngredients(); if (recipe instanceof ShapedRecipe) { ShapedRecipe shaped = (ShapedRecipe) recipe; this.ingredientsMap = shaped.getIngredientsMap(); rows.addAll(shaped.getRows()); } else if (recipe instanceof ShapelessRecipe) { } return this; }  ShapedRecipe buildShapedRecipe(); ShapelessRecipe buildShapelessRecipe(); SmeltedRecipe buildSmeltedRecipe(); RecipeBuilder setPlugin(Plugin plugin); RecipeBuilder setResult(ItemStack result); RecipeBuilder setResult(Material material, int amount); RecipeBuilder setIngredient(Character c, Material ingredient); RecipeBuilder setIngredients(Map<Character, Material> chars); RecipeBuilder addIngredient(Material ingredient); RecipeBuilder addIngredient(Material material, int amount); RecipeBuilder addIngredients(Collection<Material> ingredient); RecipeBuilder addIngredients(Material... i); RecipeBuilder removeIngredient(Material material); RecipeBuilder addRow(Character... chars); RecipeBuilder addRow(List<Character> row); RecipeBuilder addRow(String str); RecipeBuilder removeRow(int rowNumber); RecipeBuilder replaceRow(int rowNumber, List<Character> newRow); RecipeBuilder replaceRow(int rowNumber, String str); RecipeBuilder clone(Recipe recipe); RecipeBuilder setIncludeData(boolean includeData); public Plugin plugin; public ItemStack result; public Map<Character, Material> ingredientsMap; public List<List<Character>> rows; public List<Material> ingredients; public boolean includeData; }### Answer:
@Test public void cloneTest() { RecipeBuilder builder = new RecipeBuilder(); builder.setIngredient('A', BlockMaterial.SOLID_BLUE).setIngredient('B', BlockMaterial.UNBREAKABLE); builder.addRow("AAA").addRow("BBB").addRow("AAA"); builder.setResult(BlockMaterial.SOLID_BLUE, 1); ShapedRecipe recipe1 = builder.buildShapedRecipe(); RecipeBuilder builder2 = new RecipeBuilder(); builder2.clone(recipe1); builder2.replaceRow(1, "CCC"); ShapedRecipe recipe2 = builder2.buildShapedRecipe(); assertTrue(!recipe1.equals(recipe2)); RecipeBuilder builder3 = new RecipeBuilder(); builder3.setIngredient('A', BlockMaterial.SOLID_BLUE).setIngredient('C', BlockMaterial.UNBREAKABLE); builder3.addRow("AAA").addRow("CCC").addRow("AAA"); builder3.setResult(BlockMaterial.SOLID_BLUE, 1); ShapedRecipe recipe3 = builder3.buildShapedRecipe(); assertTrue(recipe2.equals(recipe3)); }