While creating a new dish object a negative price is accepted. Obviously the price should be above 0. public Dish(String s, double d, int i) { this.name = s; this.price = d; this.id = i; I believe there should me a message shown to the canteen management that an error has been made and the price should be > 0.
I have identified the problem. Initially we didn't check for negative values in variable "d". The problem has been solved by throwing the following error, when a negative value is encountered: IllegalArgumentException("Negative price"); The problem is solved, and I mark this bug as "resolved".