Flexible law checking for Scala