In the current code, when both partitions happen to have zero-length, the return mean will be NaN.
Consequently, the result of mean after reducing over all partitions will also be NaN,
which is not correct if there are partitions with non-zero length. This patch fixes this issue.
Add zeroLengthPartitions() test to make sure, e.g., StatCounter.scala can handle empty partitions without incorrectly returning NaN
Move zero-length partition testing from JavaAPISuite.java to PartitioningSuite.scala
Import just scala.math.abs rather than scala.math._
Merge pull request #643 from adatao/master

Bug fix: Zero-length partitions result in NaN for overall mean & variance