testing2/danube_test3.scala
changeset 263 5a16bcb4105e
child 284 9a04eb6a2291
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testing2/danube_test3.scala	Sat Feb 02 13:38:47 2019 +0000
@@ -0,0 +1,8 @@
+
+val ls_urban = List(("1", "a"), ("2", "a"), ("1", "c"), ("2", "a"), ("1", "c"))
+
+val m_urban = groupById(ls_urban, Map())
+
+assert(m_urban.getOrElse("1", Nil).count(_ == "c") == 2)
+assert(m_urban.getOrElse("1", Nil).count(_ == "a") == 1)
+assert(m_urban.getOrElse("2", Nil) == List("a", "a"))