The problem here is that requirements are ambiguous. The LG should seek clarification. BTW, I would write the code this way: myShoppingCart.add(new Baozi(1 jin)); if (seenWatermellon==true){ myShoppingCart.add(new Object()); } //This meets the requirements. Of course, you do not know what the object is . He can call his wife for more info. public abstract class AskWhatToBuy{ public static object askWhatToBuy(){......} } It's good humor. Us nerds love it.