// Path: kheera-testrunner/src/main/java/gherkin/pickles/PickleCell.java
// public class PickleCell {
//     private final PickleLocation location;
//     private final String value;
// 
//     public PickleCell(PickleLocation location, String value) {
//         this.location = location;
//         this.value = value;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// 
//     public PickleLocation getLocation() {
//         return location;
//     }
// }
// 
// Path: kheera-testrunner/src/main/java/gherkin/pickles/PickleRow.java
// public class PickleRow {
//     private final List<PickleCell> cells;
// 
//     public PickleRow(List<PickleCell> cells) {
//         this.cells = unmodifiableList(cells);
//     }
// 
//     public List<PickleCell> getCells() {
//         return cells;
//     }
// 
// }
// 
// Path: kheera-testrunner/src/main/java/gherkin/pickles/PickleTable.java
// public class PickleTable implements Argument {
// 
//     private final List<PickleRow> rows;
// 
//     public PickleTable(List<PickleRow> rows) {
//         this.rows = unmodifiableList(rows);
//     }
// 
//     public List<PickleRow> getRows() {
//         return rows;
//     }
// 
//     @Override
//     public PickleLocation getLocation() {
//         return rows.get(0).getCells().get(0).getLocation();
//     }
// }


import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import de.jodamob.reflect.SuperReflect;
import gherkin.pickles.PickleCell;
import gherkin.pickles.PickleRow;
import gherkin.pickles.PickleTable;
        } else {
            return null;
        }
    }

    static <T> List<T> toList(PickleTable dataTable, Type itemType, JsonElement testData) {
        List<T> result = new ArrayList<T>();
        List<String> keys = convertTopCellsToFieldNames(raw(dataTable.getRows().get(0)));
        int count = dataTable.getRows().size();
        for (int i = 1; i < count; i++) {
            List<String> valueRow = raw(dataTable.getRows().get(i));
            T item = (T) SuperReflect.on((Class) itemType).create().get();
            int j = 0;
            for (String cell : valueRow) {
                SuperReflect.on(item).set(keys.get(j), cell);
                j++;
            }
            result.add(item);
        }
        return Collections.unmodifiableList(result);
    }

    static List<String> toStringList(PickleTable dataTable, JsonElement testData) {
        List<String> result = new ArrayList<String>();
        int count = dataTable.getRows().size();
        if (count == 1) {
            for (PickleCell cell : dataTable.getRows().get(0).getCells()) {
                result.add(replaceWithTestData(testData, cell.getValue()));
            }
        } else {
// Path: kheera-testrunner/src/main/java/gherkin/pickles/PickleCell.java
// public class PickleCell {
//     private final PickleLocation location;
//     private final String value;
// 
//     public PickleCell(PickleLocation location, String value) {
//         this.location = location;
//         this.value = value;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// 
//     public PickleLocation getLocation() {
//         return location;
//     }
// }
// 
// Path: kheera-testrunner/src/main/java/gherkin/pickles/PickleRow.java
// public class PickleRow {
//     private final List<PickleCell> cells;
// 
//     public PickleRow(List<PickleCell> cells) {
//         this.cells = unmodifiableList(cells);
//     }
// 
//     public List<PickleCell> getCells() {
//         return cells;
//     }
// 
// }
// 
// Path: kheera-testrunner/src/main/java/gherkin/pickles/PickleTable.java
// public class PickleTable implements Argument {
// 
//     private final List<PickleRow> rows;
// 
//     public PickleTable(List<PickleRow> rows) {
//         this.rows = unmodifiableList(rows);
//     }
// 
//     public List<PickleRow> getRows() {
//         return rows;
//     }
// 
//     @Override
//     public PickleLocation getLocation() {
//         return rows.get(0).getCells().get(0).getLocation();
//     }
// }


// Path: kheera-testrunner/src/main/java/gherkin/TableConverter.java
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import de.jodamob.reflect.SuperReflect;
import gherkin.pickles.PickleCell;
import gherkin.pickles.PickleRow;
import gherkin.pickles.PickleTable;

        } else {
            return null;
        }
    }

    static <T> List<T> toList(PickleTable dataTable, Type itemType, JsonElement testData) {
        List<T> result = new ArrayList<T>();
        List<String> keys = convertTopCellsToFieldNames(raw(dataTable.getRows().get(0)));
        int count = dataTable.getRows().size();
        for (int i = 1; i < count; i++) {
            List<String> valueRow = raw(dataTable.getRows().get(i));
            T item = (T) SuperReflect.on((Class) itemType).create().get();
            int j = 0;
            for (String cell : valueRow) {
                SuperReflect.on(item).set(keys.get(j), cell);
                j++;
            }
            result.add(item);
        }
        return Collections.unmodifiableList(result);
    }

    static List<String> toStringList(PickleTable dataTable, JsonElement testData) {
        List<String> result = new ArrayList<String>();
        int count = dataTable.getRows().size();
        if (count == 1) {
            for (PickleCell cell : dataTable.getRows().get(0).getCells()) {
                result.add(replaceWithTestData(testData, cell.getValue()));
            }
        } else {
            for (PickleRow row : dataTable.getRows()) {