Add tests for chapter 4