List vals = new ArrayList();
vals.add(new Double(2.5)); vals.add(new Double(3.5)); vals.add(new Double(4.5));
CalcResult medianResult4 = new MedianResult(vals);
CalcResult medianResult5 = medianResult4.merge(medianResult1);
assertEquals(2.75, medianResult5.toDouble(), 0);
assertEquals(3.5, medianResult4.toDouble(), 0);
//test a mock optimization
medianVisitor1.setValue(new Double(544));
medianResult1 = medianVisitor1.getResult();
try {
medianResult3 = medianResult5.merge(medianResult1);