[SPARK-2515][mllib] Chi Squared test

Does it need to be a case class? Scala compiler will add many methods to a case class and make it very hard to extend.