### Question:
DoubleMaxAggregatorBinaryFunction implements BinaryFunction<Double, Double, Double> { public Double evaluate(Double left, Double right) { if (left == null) { return right; } if (right == null) { return left; } if (left.doubleValue() < right.doubleValue()) { return right; } return left; }  Double evaluate(Double left, Double right); @Override String toString();  }### Answer:
@Test public void testNulls() throws Exception { DoubleMaxAggregatorBinaryFunction fct = (DoubleMaxAggregatorBinaryFunction) makeFunctor(); Double d = fct.evaluate(null, null); assertNull(d); d = fct.evaluate(null, 1.0); assertEquals(1.0, d.doubleValue(), DELTA); d = fct.evaluate(2.0, null); assertEquals(2.0, d.doubleValue(), DELTA); }
@Test public void testMax() throws Exception { DoubleMaxAggregatorBinaryFunction fct = (DoubleMaxAggregatorBinaryFunction) makeFunctor(); double max = 0.0; double result = 0.0; double number1 = 0.0; double number2 = 0.0; int calls = 31; Random rnd = new Random(); for (int i = 0; i < calls; i++) { number1 = rnd.nextDouble(); number2 = rnd.nextDouble(); max = Math.max(number1, number2); result = fct.evaluate(number1, number2); assertEquals(result, max, DELTA); } }