Program: 61270
Project: 61270
Buggy source:
/** 
 * Story: User can produce final canopy centers using a EuclideanDistanceMeasure and a CanopyReducer which clusters input centroid points to produce an output set of final canopy centroid points.
 */
public void testCanopyReducerEuclidean() throws Exception {
  MeanShiftCanopyClusterer clusterer=new MeanShiftCanopyClusterer(euclideanDistanceMeasure,4,1,0.5);
  List<MeanShiftCanopy> canopies=getInitialCanopies();
  List<MeanShiftCanopy> mapperReference=new ArrayList<MeanShiftCanopy>();
  int nextCanopyId=0;
  for (  Vector aRaw : raw) {
    clusterer.mergeCanopy(new MeanShiftCanopy(aRaw,nextCanopyId++),mapperReference);
  }
  for (  MeanShiftCanopy canopy : mapperReference) {
    clusterer.shiftToMean(canopy);
  }
  List<MeanShiftCanopy> reducerReference=new ArrayList<MeanShiftCanopy>();
  for (  MeanShiftCanopy canopy : mapperReference) {
    clusterer.mergeCanopy(canopy,reducerReference);
  }
  for (  MeanShiftCanopy canopy : reducerReference) {
    clusterer.shiftToMean(canopy);
  }
  Configuration conf=new Configuration();
  conf.set(MeanShiftCanopyConfigKeys.DISTANCE_MEASURE_KEY,"String_Node_Str");
  conf.set(MeanShiftCanopyConfigKeys.T1_KEY,"String_Node_Str");
  conf.set(MeanShiftCanopyConfigKeys.T2_KEY,"String_Node_Str");
  conf.set(MeanShiftCanopyConfigKeys.CLUSTER_CONVERGENCE_KEY,"String_Node_Str");
  MeanShiftCanopyMapper mapper=new MeanShiftCanopyMapper();
  DummyRecordWriter<Text,MeanShiftCanopy> mapWriter=new DummyRecordWriter<Text,MeanShiftCanopy>();
  Mapper<WritableComparable<?>,MeanShiftCanopy,Text,MeanShiftCanopy>.Context mapContext=DummyRecordWriter.build(mapper,conf,mapWriter);
  mapper.setup(mapContext);
  for (  MeanShiftCanopy canopy : canopies) {
    mapper.map(new Text(),canopy,mapContext);
  }
  mapper.cleanup(mapContext);
  assertEquals("String_Node_Str",1,mapWriter.getData().size());
  MeanShiftCanopyReducer reducer=new MeanShiftCanopyReducer();
  DummyRecordWriter<Text,MeanShiftCanopy> reduceWriter=new DummyRecordWriter<Text,MeanShiftCanopy>();
  Reducer<Text,MeanShiftCanopy,Text,MeanShiftCanopy>.Context reduceContext=DummyRecordWriter.build(reducer,conf,reduceWriter,Text.class,MeanShiftCanopy.class);
  reducer.setup(reduceContext);
  reducer.reduce(new Text("String_Node_Str"),mapWriter.getValue(new Text("String_Node_Str")),reduceContext);
  reducer.cleanup(reduceContext);
  assertEquals("String_Node_Str",reducerReference.size(),reduceWriter.getKeys().size());
  Map<String,MeanShiftCanopy> reducerReferenceMap=new HashMap<String,MeanShiftCanopy>();
  for (  MeanShiftCanopy canopy : reducerReference) {
    reducerReferenceMap.put(canopy.getIdentifier(),canopy);
  }
  for (  Map.Entry<String,MeanShiftCanopy> mapEntry : reducerReferenceMap.entrySet()) {
    MeanShiftCanopy refCanopy=mapEntry.getValue();
    List<MeanShiftCanopy> values=reduceWriter.getValue(new Text((refCanopy.isConverged() ? "String_Node_Str" : "String_Node_Str") + refCanopy.getCanopyId()));
    assertEquals("String_Node_Str",1,values.size());
    MeanShiftCanopy reducerCanopy=values.get(0);
    assertEquals("String_Node_Str",refCanopy.getCanopyId(),reducerCanopy.getCanopyId());
    int refNumPoints=refCanopy.getNumPoints();
    int reducerNumPoints=reducerCanopy.getNumPoints();
    assertEquals("String_Node_Str",refNumPoints,reducerNumPoints);
    String refCenter=refCanopy.getCenter().asFormatString();
    String reducerCenter=reducerCanopy.getCenter().asFormatString();
    assertEquals("String_Node_Str" + mapEntry.getKey() + ')',refCenter,reducerCenter);
    assertEquals("String_Node_Str",refCanopy.getBoundPoints().size(),reducerCanopy.getBoundPoints().size());
  }
}

Fixed version (ground truth):
/** 
 * Story: User can produce final canopy centers using a EuclideanDistanceMeasure and a CanopyReducer which clusters input centroid points to produce an output set of final canopy centroid points.
 */
public void testCanopyReducerEuclidean() throws Exception {
  MeanShiftCanopyClusterer clusterer=new MeanShiftCanopyClusterer(euclideanDistanceMeasure,4,1,0.5);
  List<MeanShiftCanopy> canopies=getInitialCanopies();
  List<MeanShiftCanopy> mapperReference=new ArrayList<MeanShiftCanopy>();
  int nextCanopyId=0;
  for (  Vector aRaw : raw) {
    clusterer.mergeCanopy(new MeanShiftCanopy(aRaw,nextCanopyId++),mapperReference);
  }
  for (  MeanShiftCanopy canopy : mapperReference) {
    clusterer.shiftToMean(canopy);
  }
  List<MeanShiftCanopy> reducerReference=new ArrayList<MeanShiftCanopy>();
  for (  MeanShiftCanopy canopy : mapperReference) {
    clusterer.mergeCanopy(canopy,reducerReference);
  }
  for (  MeanShiftCanopy canopy : reducerReference) {
    clusterer.shiftToMean(canopy);
  }
  Configuration conf=new Configuration();
  conf.set(MeanShiftCanopyConfigKeys.DISTANCE_MEASURE_KEY,"String_Node_Str");
  conf.set(MeanShiftCanopyConfigKeys.T1_KEY,"String_Node_Str");
  conf.set(MeanShiftCanopyConfigKeys.T2_KEY,"String_Node_Str");
  conf.set(MeanShiftCanopyConfigKeys.CLUSTER_CONVERGENCE_KEY,"String_Node_Str");
  MeanShiftCanopyMapper mapper=new MeanShiftCanopyMapper();
  DummyRecordWriter<Text,MeanShiftCanopy> mapWriter=new DummyRecordWriter<Text,MeanShiftCanopy>();
  Mapper<WritableComparable<?>,MeanShiftCanopy,Text,MeanShiftCanopy>.Context mapContext=DummyRecordWriter.build(mapper,conf,mapWriter);
  mapper.setup(mapContext);
  for (  MeanShiftCanopy canopy : canopies) {
    mapper.map(new Text(),canopy,mapContext);
  }
  mapper.cleanup(mapContext);
  assertEquals("String_Node_Str",1,mapWriter.getData().size());
  MeanShiftCanopyReducer reducer=new MeanShiftCanopyReducer();
  DummyRecordWriter<Text,MeanShiftCanopy> reduceWriter=new DummyRecordWriter<Text,MeanShiftCanopy>();
  Reducer<Text,MeanShiftCanopy,Text,MeanShiftCanopy>.Context reduceContext=DummyRecordWriter.build(reducer,conf,reduceWriter,Text.class,MeanShiftCanopy.class);
  reducer.setup(reduceContext);
  reducer.reduce(new Text("String_Node_Str"),mapWriter.getValue(new Text("String_Node_Str")),reduceContext);
  reducer.cleanup(reduceContext);
  assertEquals("String_Node_Str",reducerReference.size(),reduceWriter.getKeys().size());
  Map<String,MeanShiftCanopy> reducerReferenceMap=new HashMap<String,MeanShiftCanopy>();
  for (  MeanShiftCanopy canopy : reducerReference) {
    reducerReferenceMap.put(canopy.getIdentifier(),canopy);
  }
  for (  Map.Entry<String,MeanShiftCanopy> mapEntry : reducerReferenceMap.entrySet()) {
    MeanShiftCanopy refCanopy=mapEntry.getValue();
    List<MeanShiftCanopy> values=reduceWriter.getValue(new Text((refCanopy.isConverged() ? "String_Node_Str" : "String_Node_Str") + refCanopy.getCanopyId()));
    assertEquals("String_Node_Str",1,values.size());
    MeanShiftCanopy reducerCanopy=values.get(0);
    assertEquals("String_Node_Str",refCanopy.getCanopyId(),reducerCanopy.getCanopyId());
    int refNumPoints=refCanopy.getNumPoints();
    int reducerNumPoints=reducerCanopy.getNumPoints();
    assertEquals("String_Node_Str",refNumPoints,reducerNumPoints);
    String refCenter=refCanopy.getCenter().asFormatString();
    String reducerCenter=reducerCanopy.getCenter().asFormatString();
    assertEquals("String_Node_Str" + mapEntry.getKey() + ')',refCenter,reducerCenter);
    assertEquals("String_Node_Str",refCanopy.getBoundPoints().toList().size(),reducerCanopy.getBoundPoints().toList().size());
  }
}