### Question:
KernelDensity implements QuadratureRule { public double[] evaluate(){ if(density!=null) return density; density = new double[numPoints]; for(int i=0;i<numPoints;i++){ density[i] = sum[i]/(n*h); } return density; } KernelDensity(KernelFunction kernel, Bandwidth h, UniformQuadratureRule uniform); void increment(double x); double[] evaluate(); double[] evaluate(double[] x); double[] evaluate(double[] x, int index); double[] getPoints(); int getNumberOfPoints(); Bandwidth getBandwidth(); UnivariateFunction getInterpolater(); UnivariateFunction getInterpolater2(); double getPointAt(int index); double getDensityAt(int index); void setDensityAt(int index, double value); void setPointAt(int index, double value); double getMinimum(); double getMaximum(); double getMean(); double getStandardDeviation(); double[] standardize(boolean keepPoints);  }### Answer:
@Test public void testDensity()throws Exception{ System.out.print("Testing kernel evaluate strict criterion, non-incremental"); GaussianKernel kernel = new GaussianKernel(); KernelDensity den = new KernelDensity(kernel, bw, points); double[] d = den.evaluate(x); for(int i=0;i<d.length;i++){ assertEquals("Strict kernel evaluate test non-incremental", 0.00, d[i] - trueDensity[i], 1e-4); } }