Test cases for problem 2