Filtering Greeting Messages


  1. First think about how you could test whether the message in each case is a Christmas message. What string is present in all of those messages, and what method could you use to test whether it is present?
  2. You'll then need to write a conditional test of the form operand1 operator operand2. Is the thing on the left equal to the thing on the right? Or in this case, does the method call on the left return the result on the right?
  3. Hint: In this case it is probably more useful to test whether the method call isn't equal to a certain result.
  4. Hint: The if statement is looking for anything in the list that is not equal to not containing the substring "Christmas", and therefore will find anything that does include that substring.

My version of this exercise.