package com.insightfullogic.honest_profiler.framework;

import static com.insightfullogic.honest_profiler.framework.LogEventFactory.SCENARIOS;
import static java.util.Arrays.asList;

import java.util.ArrayList;
import java.util.List;

import com.insightfullogic.honest_profiler.core.aggregation.grouping.FrameGrouping;
import com.insightfullogic.honest_profiler.core.aggregation.grouping.ThreadGrouping;
import com.insightfullogic.honest_profiler.framework.scenario.FltScenario;

/**
 * Utility class for constructing parameter collections for JUnit parameterized tests.
 */
public class ParameterUtil
{
    // Class Methods

    public static final List<Object[]> getScenarios()
    {
        List<Object[]> result = new ArrayList<>();
        SCENARIOS.forEach(sc -> result.add(new Object[]
        { sc }));
        return result;
    }

    public static final List<Object[]> getScenariosAndFrameGroupings()
    {
        List<Object[]> result = new ArrayList<>();
        SCENARIOS.forEach(sc -> asList(FrameGrouping.values()).forEach(fg -> result.add(new Object[]
        { sc, fg })));
        return result;
    }

    public static final List<Object[]> getScenariosAndGroupings()
    {
        List<Object[]> result = new ArrayList<>();
        SCENARIOS.forEach(
            sc -> asList(ThreadGrouping.values())
                .forEach(tg -> asList(FrameGrouping.values()).forEach(fg -> result.add(new Object[]
            { sc, tg, fg }))));
        return result;
    }

    public static final List<Object[]> getDiffScenariosAndFrameGroupings()
    {
        List<Object[]> result = new ArrayList<>();
        SCENARIOS.forEach(
            sc -> asList(FrameGrouping.values()).forEach(fg ->
            {
                result.add(new Object[]
                { sc, SCENARIOS.get(6), fg });
                result.add(new Object[]
                { sc, SCENARIOS.get(7), fg });
            }));
        return result;
    }

    public static final List<Object[]> getDiffScenariosAndGroupings()
    {
        List<Object[]> result = new ArrayList<>();
        SCENARIOS.forEach(
            sc -> asList(ThreadGrouping.values())
                .forEach(tg -> asList(FrameGrouping.values()).forEach(fg ->
                {
                    result.add(new Object[]
                    { sc, SCENARIOS.get(6), tg, fg });
                    result.add(new Object[]
                    { sc, SCENARIOS.get(7), tg, fg });
                })));
        return result;
    }

    public static final List<Object[]> getFilterScenarios()
    {
        List<Object[]> result = new ArrayList<>();
        SCENARIOS.forEach(
            sc -> asList(ThreadGrouping.values()).forEach(
                tg -> asList(FrameGrouping.values())
                    .forEach(fg -> FltScenario.getScenarios().forEach(fsc -> result.add(new Object[]
                { sc, tg, fg, fsc })))));
        return result;
    }

    public static final List<Object[]> getDebugScenariosAndGroupings()
    {
        List<Object[]> result = new ArrayList<>();
        SCENARIOS.forEach(
            sc -> asList(ThreadGrouping.values())
                .forEach(tg -> asList(FrameGrouping.values()).forEach(fg -> result.add(new Object[]
            { sc, tg, fg }))));
        return result.subList(0, 5);
    }

    // Instance Constructors

    private ParameterUtil()
    {
        // Private utility class constructor.
    }
}

@@ -601,30 +601,8 @@
 l%0A%7B%0A
-    // Class Methods%0A%0A
     
@@ -607,38 +607,32 @@
   public static 
-final 
 List%3CObject%5B%5D%3E g
@@ -816,38 +816,32 @@
   public static 
-final 
 List%3CObject%5B%5D%3E g
@@ -1092,38 +1092,32 @@
   public static 
-final 
 List%3CObject%5B%5D%3E g
@@ -1448,38 +1448,32 @@
   public static 
-final 
 List%3CObject%5B%5D%3E g
@@ -1899,38 +1899,32 @@
   public static 
-final 
 List%3CObject%5B%5D%3E g
@@ -2441,38 +2441,32 @@
   public static 
-final 
 List%3CObject%5B%5D%3E g
@@ -2851,426 +2851,15 @@
 lt;%0A
+
     %7D%0A%0A
-    public static final List%3CObject%5B%5D%3E getDebugScenariosAndGroupings()%0A    %7B%0A        List%3CObject%5B%5D%3E result = new ArrayList%3C%3E();%0A        SCENARIOS.forEach(%0A            sc -%3E asList(ThreadGrouping.values())%0A                .forEach(tg -%3E asList(FrameGrouping.values()).forEach(fg -%3E result.add(new Object%5B%5D%0A            %7B sc, tg, fg %7D))));%0A        return result.subList(0, 5);%0A    %7D%0A%0A    // Instance Constructors%0A%0A
     

remove dead code