int[] expect = EXPECTED_NUM_POINTS[k];
DummyOutputCollector<IntWritable, WeightedVectorWritable> collector = new DummyOutputCollector<IntWritable, WeightedVectorWritable>();
// The key is the clusterId
IntWritable clusterId = new IntWritable(0);
// The value is the weighted vector
WeightedVectorWritable value = new WeightedVectorWritable();
while (reader.next(clusterId, value)) {
collector.collect(clusterId, value);
clusterId = new IntWritable(0);
value = new WeightedVectorWritable();
}
reader.close();
if (k == 2) {
// cluster 3 is empty so won't appear in output
assertEquals("clusters[" + k + ']', expect.length - 1, collector.getKeys().size());