Add tests for chapter 6