// Path: kheera-testrunner/src/main/java/gherkin/pickles/Pickle.java
// public class Pickle {
//     private final String name;
//     private final List<PickleStep> steps;
//     private final List<PickleTag> tags;
//     private final List<PickleLocation> locations;
// 
//     public Pickle(String name, List<PickleStep> steps, List<PickleTag> tags, List<PickleLocation> locations) {
//         this.name = name;
//         this.steps = unmodifiableList(steps);
//         this.tags = tags;
//         this.locations = unmodifiableList(locations);
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public List<PickleStep> getSteps() {
//         return steps;
//     }
// 
//     public List<PickleLocation> getLocations() {
//         return locations;
//     }
// 
//     public List<PickleTag> getTags() { return tags; }
// 
//     public String getIdentification() {
//         StringBuilder builder = new StringBuilder();
//         for (PickleLocation loc : locations) {
//             builder.append(loc.getPath());
//             builder.append(loc.getLine());
//             builder.append(loc.getColumn());
//         }
//         builder.append(name);
//         return builder.toString();
//     }
// }


import android.content.Context;
import com.kheera.annotations.TestModule;
import com.kheera.annotations.RootTestModule;
import com.kheera.annotations.OnFinishTest;
import com.kheera.annotations.OnStartTest;
import com.kheera.annotations.TestStep;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import androidx.test.core.app.ApplicationProvider;
import dalvik.system.DexFile;
import gherkin.pickles.Pickle;
package com.kheera.internal;





/**
 * Created by andrewc on 4/07/2016.
 */
public class StepDefFunctionTable {

    private final HashSet<OnStartMethodMappingEntry> declaredBeforeMethods;
    private final HashMap<String, TestStepMappingEntry> declaredTestStepMethods;
    private final HashSet<OnFinishMethodMappingEntry> declaredFinishMethods;
    private final HashMap<String, TestStepMappingEntry> expressionCache;
    private final Context context;
    private final Class<? extends StepDefinition> stepDefClass;
    private final StepDefinition stepDefObject;

    //private Class gerkinRootClass;
    //private Object gerkinRootObject;

    private boolean enableExpressionCache = true;

    public StepDefFunctionTable(Context context, StepDefinition stepDef) throws AutomationRunnerException{
        this.context = context;
        this.stepDefClass = stepDef.getClass();
        this.stepDefObject = stepDef;
        this.declaredBeforeMethods = new HashSet<OnStartMethodMappingEntry>();
        this.declaredTestStepMethods = new HashMap<String, TestStepMappingEntry>();
        this.declaredFinishMethods = new HashSet<OnFinishMethodMappingEntry>();
        this.expressionCache = new HashMap<String, TestStepMappingEntry>();

        if(stepDefClass != null) {
            indexStepDefClass();
        }
    }

    private void indexStepDefClass() throws AutomationRunnerException {
        indexStepsOnModule(stepDefObject);
    }

// Path: kheera-testrunner/src/main/java/gherkin/pickles/Pickle.java
// public class Pickle {
//     private final String name;
//     private final List<PickleStep> steps;
//     private final List<PickleTag> tags;
//     private final List<PickleLocation> locations;
// 
//     public Pickle(String name, List<PickleStep> steps, List<PickleTag> tags, List<PickleLocation> locations) {
//         this.name = name;
//         this.steps = unmodifiableList(steps);
//         this.tags = tags;
//         this.locations = unmodifiableList(locations);
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public List<PickleStep> getSteps() {
//         return steps;
//     }
// 
//     public List<PickleLocation> getLocations() {
//         return locations;
//     }
// 
//     public List<PickleTag> getTags() { return tags; }
// 
//     public String getIdentification() {
//         StringBuilder builder = new StringBuilder();
//         for (PickleLocation loc : locations) {
//             builder.append(loc.getPath());
//             builder.append(loc.getLine());
//             builder.append(loc.getColumn());
//         }
//         builder.append(name);
//         return builder.toString();
//     }
// }


// Path: kheera-testrunner/src/main/java/com/kheera/internal/StepDefFunctionTable.java
import android.content.Context;
import com.kheera.annotations.TestModule;
import com.kheera.annotations.RootTestModule;
import com.kheera.annotations.OnFinishTest;
import com.kheera.annotations.OnStartTest;
import com.kheera.annotations.TestStep;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import androidx.test.core.app.ApplicationProvider;
import dalvik.system.DexFile;
import gherkin.pickles.Pickle;

package com.kheera.internal;





/**
 * Created by andrewc on 4/07/2016.
 */
public class StepDefFunctionTable {

    private final HashSet<OnStartMethodMappingEntry> declaredBeforeMethods;
    private final HashMap<String, TestStepMappingEntry> declaredTestStepMethods;
    private final HashSet<OnFinishMethodMappingEntry> declaredFinishMethods;
    private final HashMap<String, TestStepMappingEntry> expressionCache;
    private final Context context;
    private final Class<? extends StepDefinition> stepDefClass;
    private final StepDefinition stepDefObject;

    //private Class gerkinRootClass;
    //private Object gerkinRootObject;

    private boolean enableExpressionCache = true;

    public StepDefFunctionTable(Context context, StepDefinition stepDef) throws AutomationRunnerException{
        this.context = context;
        this.stepDefClass = stepDef.getClass();
        this.stepDefObject = stepDef;
        this.declaredBeforeMethods = new HashSet<OnStartMethodMappingEntry>();
        this.declaredTestStepMethods = new HashMap<String, TestStepMappingEntry>();
        this.declaredFinishMethods = new HashSet<OnFinishMethodMappingEntry>();
        this.expressionCache = new HashMap<String, TestStepMappingEntry>();

        if(stepDefClass != null) {
            indexStepDefClass();
        }
    }

    private void indexStepDefClass() throws AutomationRunnerException {
        indexStepsOnModule(stepDefObject);
    }

    public Set<OnFinishMethodMappingEntry> findOnFinishMethod(Pickle pickle) {