private static Map<String, Object>[] getParamsets(List<String> fnames, List data) {
        int cols = fnames.size();
        if (cols<1) {
            throw new ComponentException("no field mapping information for test data");
        }
        int rows = (data.size() / fnames.size()) - 1;
        if (rows < 1) {
            throw new ComponentException("no test data provided.");
        }
        int idx = cols;   // skip the header

        Map<String, Object>[] ps = new HashMap[rows];
        for (int r = 0; r < rows; r++) {
            ps[r] = new HashMap<String, Object>();
            for (int c = 0; c < cols; c++) {
                ps[r].put(fnames.get(c), data.get(idx++));
                if (idx > data.size()) {
                    throw new ComponentException("Invalid test parameter set, check the data size.");
                }
            }
        }
        return ps;
    }