package org.usi.sq.util;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;


class CollectionUtilsTest {
    private static final double EPSILON = 1e-6;

    @Test
    void testMean_Normal() {
        int[] values = new int[]{1,2,3,4};

        double actual = CollectionUtils.mean(values,0,4);
        assertEquals(2.5, actual, EPSILON);
    }

    @Test
    void testMean_ZeroLength() {
        int[] values = new int[]{1,2,3,4};

        double actual = CollectionUtils.mean(values,0,0);
        assertEquals(Double.NaN, actual, EPSILON);
    }
}
