@Test
public void testFindPeak() throws Exception {

    double[] test_correlations = {0, 0.9, 0.6, 0.7, 0.8, 0.5, 0, 0.1, 0.2, -0.5, -0.1, 0, -0.5, 0.8, 0, 0.8, 0.7, 0.6, 0.5, 0.4, 0.5};
    Autocorrelation acf = new Autocorrelation(test_correlations.length, 0);
    acf.correlations = new double[test_correlations.length];
    for (int i = 0; i < test_correlations.length; i ++) { acf.correlations[i] = test_correlations[i]; }
    List<Integer> peaks = acf.findPeaks();
    int[] expected_peaks = {4, 13, 15};
    assertEquals(expected_peaks.length, peaks.size());
    for (int i = 0; i < peaks.size(); i ++) {
        assertTrue(expected_peaks[i] == peaks.get(i));
    }
}