I need help with the TestRecipeBook.java class… I cant seem to…

QuestionAnswered step-by-stepI need help with the TestRecipeBook.java class… I cant seem to…Image transcription textFiles: Ingredient.java , RecipeIngredient .java ,CookingRecipe .java , RecipeBook .java ,TestRecipeBook .java You will be creati… Show moreImage transcription textpublic float calculateCaloriesO calculates thesum of the calories for all the ingredients inthe recipes and their respective… Show moreI need help with the TestRecipeBook.java class… I cant seem to figure out how to test all my methods.I have pasted each of my classes including what i have for TestRecipeBook.I need help with this part. I cant figure out why my findRecipesWithFewIngredients(4); is not working when being ran. I also am not sure how to implement 1. findRecipesLowCalories()2.removeRecipe3.removeRecipeIngredient4.calculateCalories()5.getNumberOfIngredients() I will copy and paste what I have :  Ingredient Class:public class Ingredient { private String name , measuringUnit;private int caloriesPerUnit;  public Ingredient(String name, String measuringUnit, int caloriesPerUnit) {this.name = name;this.measuringUnit = measuringUnit;this.caloriesPerUnit = caloriesPerUnit;} public String getName() {return name;} public String getMeasuringUnit() {return measuringUnit;} public int getCaloriesPerUnit() {return caloriesPerUnit;} public String toString() {return  ” Ingredient Name:   ” + name + ” nMeasuring Unit:   ” + measuringUnit + ” nCalories Per Unit & Amount of Units:   ” + caloriesPerUnit; }}  RecipeIngredient Class:public class RecipeIngredient extends Ingredient {private float quantity; public RecipeIngredient(String name, String measuringUnit, int caloriesPerUnit,float quantity) {super(name, measuringUnit, caloriesPerUnit);this.quantity = quantity;} public void setQuantity(float quantity) {this.quantity = quantity;} public float getQuantity() {return quantity;} public float getCalories() {return quantity * getCaloriesPerUnit();} public String toString() {return “n” + “nRecipe” + super.toString() + ” , ” + quantity + ” ” +getMeasuringUnit(); } public boolean equals(Object o)  { if (o instanceof Ingredient)return ((Ingredient)o).getName().equals(getName());return false; }} CookingRecipe Class:import java.util.ArrayList; public class CookingRecipe {private ArrayList ingredients = new ArrayList();private String name; public CookingRecipe(String name) {this.name = name;} public void addOrUpdateRecipeIngredient(Ingredient ingredient, float quantity) { if (ingredients.contains(ingredient)) {int i = ingredients.indexOf(ingredient);ingredients.get(i).setQuantity(quantity);return;} ingredients.add(new RecipeIngredient(ingredient.getName(),ingredient.getMeasuringUnit(),ingredient.getCaloriesPerUnit(),quantity));} public RecipeIngredient getRecipeIngredient(Ingredient ingredient) {     if (ingredients.contains(ingredient)) {    int i = ingredients.indexOf(ingredient);    return ingredients.get(i);    }    return null;} public RecipeIngredient getRecipeIngredient(String ingredientName) {     if (ingredients.contains(new Ingredient(ingredientName, “”, 100))) {    int i = ingredients.indexOf(new Ingredient(ingredientName, “”, 100));    return ingredients.get(i);    }    return null;} public RecipeIngredient removeRecipeIngredient(Ingredient ingredient) {     if (ingredients.contains(ingredient)) {    int i = ingredients.indexOf(ingredient);    RecipeIngredient r = ingredients.get(i);    ingredients.remove(i);    return r;    }    return null;  } public RecipeIngredient removeRecipeIngredient(String ingredientName) {     if (ingredients.contains(new Ingredient(ingredientName, “”, 100))) {    int i = ingredients.indexOf(new Ingredient(ingredientName, “”, 100));    RecipeIngredient r = ingredients.get(i);    ingredients.remove(i);    return r;    }    return null;  } public float calculateCalories() {float sumCal = 0; for(RecipeIngredient r:ingredients)sumCal += r.getCalories();return sumCal;} public int getNumberOfIngredients() {return ingredients.size(); } public String toString() {String result = “n” + ”    Cooking Recipe” + “n     ————” + “nName: ” + name; for(RecipeIngredient r:ingredients)result += ” ” + r.toString() + “n”;return result;} public boolean equals(Object o) { if (o instanceof CookingRecipe)return ((CookingRecipe)o).name.equals(name);return false;} public boolean allIngredients(RecipeIngredient[] ingredients) { for (RecipeIngredient r:ingredients) if(!this.ingredients.contains(r))return false;return true; }} RecipeBook Class:import java.util.ArrayList; public class RecipeBook {private String bookName;private ArrayList cr = new ArrayList(); public RecipeBook(String bookName) {this.bookName = bookName;} public CookingRecipe addRecipe(String name, RecipeIngredient[] ingredients) {CookingRecipe cook = new CookingRecipe(name); if (cr.contains(cook))return null; for(RecipeIngredient r:ingredients)cook.addOrUpdateRecipeIngredient(r, r.getQuantity());cr.add(cook);return cook;} public CookingRecipe removeRecipe(String name) { if(cr.contains(new CookingRecipe(name))) {int i = cr.indexOf(new CookingRecipe(name));CookingRecipe cook = cr.get(i);cr.remove(i);return cook;}return null;      } public CookingRecipe[] findRecipes(RecipeIngredient[] ingredients){ArrayList a = new ArrayList(); for (CookingRecipe c: cr) if(c.allIngredients(ingredients)) a.add(c);CookingRecipe[] b = new CookingRecipe[a.size()]; for (int i =0; i recipiesList = null;boolean found = false; if (this.cr.size() != 0) {for (int i = 0; i < cr.size(); i++) {CookingRecipe few = this.cr.get(i);if (few.getNumberOfIngredients() <= numberOfIngredients) {if (recipiesList == null)recipiesList = new ArrayList();recipiesList.add(few);}}} if (recipiesList != null) { CookingRecipe recipeArray[] = new CookingRecipe[recipiesList.size()];int i = 0;for (CookingRecipe obj : recipiesList) {recipeArray[i++] = obj;}return recipeArray;}return null;} public CookingRecipe[] findRecipesLowCalories() {float min = cr.get(0).calculateCalories(); for(CookingRecipe c: cr)if(min>c.calculateCalories())min = c.calculateCalories(); ArrayList a = new ArrayList(); for(CookingRecipe c: cr)if (c.calculateCalories() == min)a.add(c);CookingRecipe[] b = new CookingRecipe[a.size()];for (int i =0; i