// Path: src/main/java/au/net/woodberry/ta/toolbox/enums/Group.java
// public enum Group {
//     SHORTTERM, LONGTERM
// }
// 
// Path: src/main/java/au/net/woodberry/ta/toolbox/enums/Period.java
// public enum Period {
// 
//     // Short term moving averages
//     THREE(3, Group.SHORTTERM),
//     FIVE(5, Group.SHORTTERM),
//     SEVEN(7, Group.SHORTTERM),
//     EIGHT(8, Group.SHORTTERM),
//     NINE(9, Group.SHORTTERM),
//     TEN(10, Group.SHORTTERM),
//     ELEVEN(11, Group.SHORTTERM),
//     TWELVE(12, Group.SHORTTERM),
//     THIRTEEN(13, Group.SHORTTERM),
//     FIFTEEN(15, Group.SHORTTERM),
// 
//     // Long term moving averages
//     TWENTYONE(21, Group.LONGTERM),
//     TWENTYFOUR(24, Group.LONGTERM),
//     TWENTYSEVEN(27, Group.LONGTERM),
//     THIRTY(30, Group.LONGTERM),
//     THIRTYTHREE(33, Group.LONGTERM),
//     THIRTYFIVE(35, Group.LONGTERM),
//     THIRTYSIX(36, Group.LONGTERM),
//     FORTY(40, Group.LONGTERM),
//     FORTYFIVE(45, Group.LONGTERM),
//     FIFTY(50, Group.LONGTERM),
//     SIXTY(60, Group.LONGTERM);
// 
//     private final int timeFrame;
//     private final Group group;
// 
//     Period(int timeFrame, Group group) {
//         this.timeFrame = timeFrame;
//         this.group = group;
//     }
// 
//     public Group getGroup() {
//         return group;
//     }
// 
//     public int getTimeFrame() {
//         return timeFrame;
//     }
// }
// 
// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/StubDataTestUtils.java
// public class StubDataTestUtils {
// 
//     private static final String SEPARATOR = ",";
//     private static final String COMMENT_LINE = "#";
//     private static final int TIMESTAMP = 0;
//     private static final int OPEN = 1;
//     private static final int HIGH = 2;
//     private static final int LOW = 3;
//     private static final int CLOSE = 4;
//     private static final int VOLUME = 5;
// 
//     private StubDataTestUtils() {}
// 
//     public static List<Tick> createTickData(String stubData) {
//         return createTickData(stubData, SEPARATOR, null, null);
//     }
//     
//     public static List<Tick> createTickData(String stubData, DateTimeFormatter dtf) {
//         return createTickData(stubData, SEPARATOR, null, dtf);
//     }
// 
//     public static List<Tick> createTickData(String stubData, String separator, Pattern header, DateTimeFormatter dtf) {
//         List<Tick> ticks = new ArrayList<>();
//         BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(StubDataTestUtils.class.getResourceAsStream(stubData)));
//         String line;
//         try {
//             while ((line = bufferedReader.readLine()) != null) {
//                 String[] data = line.split(separator);
//                 if (data == null || (header != null && header.matcher(line).matches()) || line.startsWith(COMMENT_LINE)) { // Headers, comments, no data
//                     continue;
//                 }
//                 DateTime dt = dtf != null ? DateTime.parse(data[TIMESTAMP], dtf) : DateTime.parse(data[TIMESTAMP]);
//                 Tick tick = new Tick(dt, Double.parseDouble(data[OPEN]), Double.parseDouble(data[HIGH]), Double.parseDouble(data[LOW]),
//                         Double.parseDouble(data[CLOSE]), Double.parseDouble(data[VOLUME]));
//                 ticks.add(tick);
//             }
//             bufferedReader.close();
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//         return ticks;
//     }
// }
// 
// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/Assertions.java
// public static void assertGuppyMultipleMovingAverage(MultipleMovingAverage gmma, boolean isComplete, Double... expectedValues) {
//     assertEquals(isComplete, gmma.isComplete());
//     assertDecimalEquals(gmma.getValue(Period.THREE), expectedValues[0]);
//     assertDecimalEquals(gmma.getValue(Period.FIVE), expectedValues[1]);
//     assertDecimalEquals(gmma.getValue(Period.EIGHT), expectedValues[2]);
//     assertDecimalEquals(gmma.getValue(Period.TEN), expectedValues[3]);
//     assertDecimalEquals(gmma.getValue(Period.TWELVE), expectedValues[4]);
//     assertDecimalEquals(gmma.getValue(Period.FIFTEEN), expectedValues[5]);
//     assertDecimalEquals(gmma.getValue(Period.THIRTY), expectedValues[6]);
//     assertDecimalEquals(gmma.getValue(Period.THIRTYFIVE), expectedValues[7]);
//     assertDecimalEquals(gmma.getValue(Period.FORTY), expectedValues[8]);
//     assertDecimalEquals(gmma.getValue(Period.FORTYFIVE), expectedValues[9]);
//     assertDecimalEquals(gmma.getValue(Period.FIFTY), expectedValues[10]);
//     assertDecimalEquals(gmma.getValue(Period.SIXTY), expectedValues[11]);
// }


import au.net.woodberry.ta.toolbox.enums.Group;
import au.net.woodberry.ta.toolbox.enums.Period;
import au.net.woodberry.ta.toolbox.indicators.StubDataTestUtils;
import eu.verdelhan.ta4j.TimeSeries;
import eu.verdelhan.ta4j.indicators.simple.ClosePriceIndicator;
import org.junit.Before;
import org.junit.Test;
import static au.net.woodberry.ta.toolbox.indicators.Assertions.assertGuppyMultipleMovingAverage;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
package au.net.woodberry.ta.toolbox.indicators.trend;



public class GuppyMultipleMovingAverageIndicatorTest {

    private GuppyMultipleMovingAverageIndicator gmmaIndicator;

    @Before
    public void before() {
// Path: src/main/java/au/net/woodberry/ta/toolbox/enums/Group.java
// public enum Group {
//     SHORTTERM, LONGTERM
// }
// 
// Path: src/main/java/au/net/woodberry/ta/toolbox/enums/Period.java
// public enum Period {
// 
//     // Short term moving averages
//     THREE(3, Group.SHORTTERM),
//     FIVE(5, Group.SHORTTERM),
//     SEVEN(7, Group.SHORTTERM),
//     EIGHT(8, Group.SHORTTERM),
//     NINE(9, Group.SHORTTERM),
//     TEN(10, Group.SHORTTERM),
//     ELEVEN(11, Group.SHORTTERM),
//     TWELVE(12, Group.SHORTTERM),
//     THIRTEEN(13, Group.SHORTTERM),
//     FIFTEEN(15, Group.SHORTTERM),
// 
//     // Long term moving averages
//     TWENTYONE(21, Group.LONGTERM),
//     TWENTYFOUR(24, Group.LONGTERM),
//     TWENTYSEVEN(27, Group.LONGTERM),
//     THIRTY(30, Group.LONGTERM),
//     THIRTYTHREE(33, Group.LONGTERM),
//     THIRTYFIVE(35, Group.LONGTERM),
//     THIRTYSIX(36, Group.LONGTERM),
//     FORTY(40, Group.LONGTERM),
//     FORTYFIVE(45, Group.LONGTERM),
//     FIFTY(50, Group.LONGTERM),
//     SIXTY(60, Group.LONGTERM);
// 
//     private final int timeFrame;
//     private final Group group;
// 
//     Period(int timeFrame, Group group) {
//         this.timeFrame = timeFrame;
//         this.group = group;
//     }
// 
//     public Group getGroup() {
//         return group;
//     }
// 
//     public int getTimeFrame() {
//         return timeFrame;
//     }
// }
// 
// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/StubDataTestUtils.java
// public class StubDataTestUtils {
// 
//     private static final String SEPARATOR = ",";
//     private static final String COMMENT_LINE = "#";
//     private static final int TIMESTAMP = 0;
//     private static final int OPEN = 1;
//     private static final int HIGH = 2;
//     private static final int LOW = 3;
//     private static final int CLOSE = 4;
//     private static final int VOLUME = 5;
// 
//     private StubDataTestUtils() {}
// 
//     public static List<Tick> createTickData(String stubData) {
//         return createTickData(stubData, SEPARATOR, null, null);
//     }
//     
//     public static List<Tick> createTickData(String stubData, DateTimeFormatter dtf) {
//         return createTickData(stubData, SEPARATOR, null, dtf);
//     }
// 
//     public static List<Tick> createTickData(String stubData, String separator, Pattern header, DateTimeFormatter dtf) {
//         List<Tick> ticks = new ArrayList<>();
//         BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(StubDataTestUtils.class.getResourceAsStream(stubData)));
//         String line;
//         try {
//             while ((line = bufferedReader.readLine()) != null) {
//                 String[] data = line.split(separator);
//                 if (data == null || (header != null && header.matcher(line).matches()) || line.startsWith(COMMENT_LINE)) { // Headers, comments, no data
//                     continue;
//                 }
//                 DateTime dt = dtf != null ? DateTime.parse(data[TIMESTAMP], dtf) : DateTime.parse(data[TIMESTAMP]);
//                 Tick tick = new Tick(dt, Double.parseDouble(data[OPEN]), Double.parseDouble(data[HIGH]), Double.parseDouble(data[LOW]),
//                         Double.parseDouble(data[CLOSE]), Double.parseDouble(data[VOLUME]));
//                 ticks.add(tick);
//             }
//             bufferedReader.close();
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//         return ticks;
//     }
// }
// 
// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/Assertions.java
// public static void assertGuppyMultipleMovingAverage(MultipleMovingAverage gmma, boolean isComplete, Double... expectedValues) {
//     assertEquals(isComplete, gmma.isComplete());
//     assertDecimalEquals(gmma.getValue(Period.THREE), expectedValues[0]);
//     assertDecimalEquals(gmma.getValue(Period.FIVE), expectedValues[1]);
//     assertDecimalEquals(gmma.getValue(Period.EIGHT), expectedValues[2]);
//     assertDecimalEquals(gmma.getValue(Period.TEN), expectedValues[3]);
//     assertDecimalEquals(gmma.getValue(Period.TWELVE), expectedValues[4]);
//     assertDecimalEquals(gmma.getValue(Period.FIFTEEN), expectedValues[5]);
//     assertDecimalEquals(gmma.getValue(Period.THIRTY), expectedValues[6]);
//     assertDecimalEquals(gmma.getValue(Period.THIRTYFIVE), expectedValues[7]);
//     assertDecimalEquals(gmma.getValue(Period.FORTY), expectedValues[8]);
//     assertDecimalEquals(gmma.getValue(Period.FORTYFIVE), expectedValues[9]);
//     assertDecimalEquals(gmma.getValue(Period.FIFTY), expectedValues[10]);
//     assertDecimalEquals(gmma.getValue(Period.SIXTY), expectedValues[11]);
// }


// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/trend/GuppyMultipleMovingAverageIndicatorTest.java
import au.net.woodberry.ta.toolbox.enums.Group;
import au.net.woodberry.ta.toolbox.enums.Period;
import au.net.woodberry.ta.toolbox.indicators.StubDataTestUtils;
import eu.verdelhan.ta4j.TimeSeries;
import eu.verdelhan.ta4j.indicators.simple.ClosePriceIndicator;
import org.junit.Before;
import org.junit.Test;
import static au.net.woodberry.ta.toolbox.indicators.Assertions.assertGuppyMultipleMovingAverage;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

package au.net.woodberry.ta.toolbox.indicators.trend;



public class GuppyMultipleMovingAverageIndicatorTest {

    private GuppyMultipleMovingAverageIndicator gmmaIndicator;

    @Before
    public void before() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_GUPPY_MULTIPLE_MOVING_AVERAGE_TC1.stub"));