Adding test cases to check the logic.