Scala cookbook 8.1 Using a trait as an interface