deprecated copy-paste code, adding scalatest