Scala Pattern and Extractor