// Path: src/main/java/org/grouchotools/jsrules/exception/InvalidParameterException.java
// public class InvalidParameterException extends JsRulesException {
// 
//     public InvalidParameterException() {
//     }
// 
//     public InvalidParameterException(String message) {
//         super(message);
//     }
// 
//     public InvalidParameterException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public InvalidParameterException(Throwable cause) {
//         super(cause);
//     }
// 
//     public InvalidParameterException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
//     
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/impl/FirstTrueRulesetListExecutorImpl.java
// public class FirstTrueRulesetListExecutorImpl<T> extends RulesetListExecutor<T> {
//     private final List<RulesetExecutor<T>> rulesetList;
//     private final String name;
// 
//     public FirstTrueRulesetListExecutorImpl(String name, List<RulesetExecutor<T>> rulesetList) {
//         this.name = name;
//         this.rulesetList = rulesetList;
//     }
// 
//     @Override
//     public T execute(Map<String, Object> parameters) throws InvalidParameterException {
//         T result = null;
//         /*
//          execute all the rules until a response is found -- if all are false, 
//          return null
//         */
//         for (RulesetExecutor<T> ruleSet : rulesetList) {
//             T ruleResponse = ruleSet.execute(parameters);
//             if (ruleResponse != null) {
//                 result = ruleResponse;
//                 break;
//             }
//         }
//         return result;
//     }
// 
//     @Override
//     public String getName() {
//         return name;
//     }
// 
// }


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.grouchotools.jsrules.exception.InvalidParameterException;
import org.grouchotools.jsrules.impl.FirstTrueRulesetListExecutorImpl;
import org.junit.*;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
        rulesetListMock = new ArrayList<>();
        parameters = new HashMap<>();

        executor = new FirstTrueRulesetListExecutorImpl<>(rulesetName, rulesetListMock);
    }

    @After
    public void tearDown() {
    }

    @Test
    public void executeFirstTrueRulesetListEmptyTest() throws Exception {
        assertNull(executor.execute(parameters));
    }

    @Test
    public void executeFirstTrueRulesetListInvalidParametersTest() throws Exception {
        exception.expect(InvalidParameterException.class);

// Path: src/main/java/org/grouchotools/jsrules/exception/InvalidParameterException.java
// public class InvalidParameterException extends JsRulesException {
// 
//     public InvalidParameterException() {
//     }
// 
//     public InvalidParameterException(String message) {
//         super(message);
//     }
// 
//     public InvalidParameterException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public InvalidParameterException(Throwable cause) {
//         super(cause);
//     }
// 
//     public InvalidParameterException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
//     
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/impl/FirstTrueRulesetListExecutorImpl.java
// public class FirstTrueRulesetListExecutorImpl<T> extends RulesetListExecutor<T> {
//     private final List<RulesetExecutor<T>> rulesetList;
//     private final String name;
// 
//     public FirstTrueRulesetListExecutorImpl(String name, List<RulesetExecutor<T>> rulesetList) {
//         this.name = name;
//         this.rulesetList = rulesetList;
//     }
// 
//     @Override
//     public T execute(Map<String, Object> parameters) throws InvalidParameterException {
//         T result = null;
//         /*
//          execute all the rules until a response is found -- if all are false, 
//          return null
//         */
//         for (RulesetExecutor<T> ruleSet : rulesetList) {
//             T ruleResponse = ruleSet.execute(parameters);
//             if (ruleResponse != null) {
//                 result = ruleResponse;
//                 break;
//             }
//         }
//         return result;
//     }
// 
//     @Override
//     public String getName() {
//         return name;
//     }
// 
// }


// Path: src/test/java/org/grouchotools/jsrules/FirstTrueRulesetListExecutorTest.java
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.grouchotools.jsrules.exception.InvalidParameterException;
import org.grouchotools.jsrules.impl.FirstTrueRulesetListExecutorImpl;
import org.junit.*;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;


    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
        rulesetListMock = new ArrayList<>();
        parameters = new HashMap<>();

        executor = new FirstTrueRulesetListExecutorImpl<>(rulesetName, rulesetListMock);
    }

    @After
    public void tearDown() {
    }

    @Test
    public void executeFirstTrueRulesetListEmptyTest() throws Exception {
        assertNull(executor.execute(parameters));
    }

    @Test
    public void executeFirstTrueRulesetListInvalidParametersTest() throws Exception {
        exception.expect(InvalidParameterException.class);

        when(rulesetExecutorMock.execute(parameters)).thenThrow(new InvalidParameterException());