### Question:
SimpleInterpolationVisitor implements Visitor<InterpolationMeasure> { @Override public InterpolationMeasure getResult() { return stored; } SimpleInterpolationVisitor(double[] pointToScore, int sampleSize, double pointMass, boolean centerOfMass); @Override InterpolationMeasure getResult(); @Override void accept(Node node, int depthOfNode); @Override void acceptLeaf(Node leafNode, int depthOfNode); public InterpolationMeasure stored; }### Answer:
@Test public void testNew() { double[] point = { 1.0, 2.0 }; int sampleSize = 9; SimpleInterpolationVisitor visitor = new SimpleInterpolationVisitor(point, sampleSize, 1, false); assertFalse(visitor.pointInsideBox); assertEquals(2, visitor.coordInsideBox.length); for (int i = 0; i < point.length; i++) { assertFalse(visitor.coordInsideBox[i]); } InterpolationMeasure output = visitor.getResult(); double[] zero = new double[point.length]; assertArrayEquals(zero, output.measure.high); assertArrayEquals(zero, output.distances.high); assertArrayEquals(zero, output.probMass.high); assertArrayEquals(zero, output.measure.low); assertArrayEquals(zero, output.distances.low); assertArrayEquals(zero, output.probMass.low); }