Doc: Migrate code examples to Scala classes