Let us create a separate test "takeSample from an empty rdd" and construct an empty rdd directly:
~~
val emptyRdd = sc.parallelize(Seq.empty[Int], 2)
~~