General Test Code in Scala