@Test
public void testAllSameValueCluster() throws IOException {
ClusteringTestUtils.writePointsToFile(referenceData, new Path(testdata, "file1"), fs, conf);
DistanceMeasure measure = new EuclideanDistanceMeasure();
initData(1, 0.25, measure);
Canopy cluster = new Canopy(new DenseVector(new double[] {0, 0}), 19, measure);
clusters.add(cluster);
List<VectorWritable> points = Lists.newArrayList();
points.add(new VectorWritable(cluster.getCenter()));
points.add(new VectorWritable(cluster.getCenter()));
points.add(new VectorWritable(cluster.getCenter()));
representativePoints.put(cluster.getId(), points);
ClusterEvaluator evaluator = new ClusterEvaluator(representativePoints, clusters, measure);
assertEquals("inter cluster density", 0.3656854249492381, evaluator.interClusterDensity(), EPSILON);
assertEquals("intra cluster density", 0.3656854249492381, evaluator.intraClusterDensity(), EPSILON);
}