@Test
public void javaDoubleRDDHistoGram() {
JavaDoubleRDD rdd = sc.parallelizeDoubles(Arrays.asList(1.0, 2.0, 3.0, 4.0));
// Test using generated buckets
Tuple2<double[], long[]> results = rdd.histogram(2);
double[] expected_buckets = {1.0, 2.5, 4.0};
long[] expected_counts = {2, 2};
Assert.assertArrayEquals(expected_buckets, results._1, 0.1);
Assert.assertArrayEquals(expected_counts, results._2);
// Test with provided buckets