Code examples from scala in action book