FuAlgo { double getPolyCorr(double hue100, double[] constPolyHue) { Assert.argument(constPolyHue.length == 6, "constPolyHue.length == 6"); double value = 0.0; for (int i = 0; i < constPolyHue.length; i++) { if ((i + 1) == constPolyHue.length) { value += constPolyHue[i]; break; } value += constPolyHue[i] * Math.pow(hue100, 5 - i); } return value; } FuAlgo(Instrument instrument);   FuAlgo(); FuResult compute(double[] spectrum); static final byte MAX_FU_VALUE; }
@Test public void testSummarizationPolyHueMeris() throws Exception { final double[] constPolyHueForMeris = new double[]{-12.0506, 88.9325, -244.6960, 305.2361, -164.6960, 28.5255}; assertEquals(1.2515000000000285, fuAlgo.getPolyCorr(1.0, constPolyHueForMeris), 1e-8); assertEquals(-1.7544999999999717, fuAlgo.getPolyCorr(2.5, constPolyHueForMeris), 1e-8); }