1 2 3 4 5 6 7 8 9 10 11 12
object Test { def main(args: Array[String]): Unit = { val m = collection.immutable.ListMap( "x" -> 1 ) try { m("y") } catch { case e : NoSuchElementException => assert(e.getMessage() == "key not found: y") } } }