Add tests from end of chapter 5 exercises