// Path: src/main/java/ro/hasna/ts/math/util/TimeSeriesPrecision.java
// public class TimeSeriesPrecision {
//     public static final double EPSILON = FastMath.pow(2, -30);
// 
//     /**
//      * Private constructor.
//      */
//     private TimeSeriesPrecision() {
//     }
// }


import org.apache.commons.math3.complex.Complex;
import org.apache.commons.math3.transform.FastFourierTransformer;
import org.apache.commons.math3.transform.TransformType;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import ro.hasna.ts.math.util.TimeSeriesPrecision;
    @Test
    public void testTransform() throws Exception {
        double[] v = {1, 2, 3};
        discreteChebyshevTransform.transform(v);

        Mockito.verify(fastFourierTransformer).transform(new double[]{1, 2, 3, 2}, TransformType.FORWARD);
    }

    @Test
    public void testTransform2() throws Exception {
        double[] v = {1, 2, 3, 4};
        discreteChebyshevTransform.transform(v);

        Mockito.verify(fastFourierTransformer).transform(new double[]{1, 2, 3, 4, 3, 2, 0, 0}, TransformType.FORWARD);
    }

    @Test
    public void testTransformSmallVector() throws Exception {
        double[] v = {1, 2};
        discreteChebyshevTransform.transform(v);

        Mockito.verify(fastFourierTransformer, Mockito.never()).transform(Mockito.<double[]>any(), Mockito.any());
    }

    @Test
    public void testTransformConcrete() throws Exception {
        double[] v = {98, 100}; // 99 * x^2 - x
        double[] expected = {99, -1};
        double[] result = new DiscreteChebyshevTransform().transform(v);

// Path: src/main/java/ro/hasna/ts/math/util/TimeSeriesPrecision.java
// public class TimeSeriesPrecision {
//     public static final double EPSILON = FastMath.pow(2, -30);
// 
//     /**
//      * Private constructor.
//      */
//     private TimeSeriesPrecision() {
//     }
// }


// Path: src/test/java/ro/hasna/ts/math/representation/DiscreteChebyshevTransformTest.java
import org.apache.commons.math3.complex.Complex;
import org.apache.commons.math3.transform.FastFourierTransformer;
import org.apache.commons.math3.transform.TransformType;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import ro.hasna.ts.math.util.TimeSeriesPrecision;

    @Test
    public void testTransform() throws Exception {
        double[] v = {1, 2, 3};
        discreteChebyshevTransform.transform(v);

        Mockito.verify(fastFourierTransformer).transform(new double[]{1, 2, 3, 2}, TransformType.FORWARD);
    }

    @Test
    public void testTransform2() throws Exception {
        double[] v = {1, 2, 3, 4};
        discreteChebyshevTransform.transform(v);

        Mockito.verify(fastFourierTransformer).transform(new double[]{1, 2, 3, 4, 3, 2, 0, 0}, TransformType.FORWARD);
    }

    @Test
    public void testTransformSmallVector() throws Exception {
        double[] v = {1, 2};
        discreteChebyshevTransform.transform(v);

        Mockito.verify(fastFourierTransformer, Mockito.never()).transform(Mockito.<double[]>any(), Mockito.any());
    }

    @Test
    public void testTransformConcrete() throws Exception {
        double[] v = {98, 100}; // 99 * x^2 - x
        double[] expected = {99, -1};
        double[] result = new DiscreteChebyshevTransform().transform(v);

        Assert.assertArrayEquals(expected, result, TimeSeriesPrecision.EPSILON);