Convert more optimization tests to ScalaTest.