@Test
public void lpcFeaturesAreAveragesOnTheLpcCoefficientsReturnedByLinearPredictiveCodingAlgorithm() {

    lpc = new LpcFeaturesExtractor(DEFAULT_SAMPLE_RATE, POLES);
    double[] voiceSample = new double[4096];
    new MockUp<LinearPredictiveCoding>() {
        private int value = 1;
        @Mock double[][] applyLinearPredictiveCoding(double[] window) {
            double[][] result = new double[2][20];
            Arrays.fill(result[0], value);
            value++;
            return result;
        }
    };
    double[] reference = new double[20];
    // given sliding window 512 with step 256 -> 15 calls to lpc algorithm
    // given the above mock :
    // (1 + 2 + 3 + ... + 15) / 15 = 8
    Arrays.fill(reference, 8.0d);
    
    double[] features = lpc.extractFeatures(voiceSample);
    
    assertThat(features, is(equalTo(reference)));
}