public StepExpression createExpression(StepDefinition stepDefinition) {
        List<ParameterInfo> parameterInfos = stepDefinition.parameterInfos();

        if (parameterInfos.isEmpty()) {
            return createExpression(
                stepDefinition.getPattern(),
                stepDefinitionDoesNotTakeAnyParameter(stepDefinition),
                false);
        }

        ParameterInfo parameterInfo = parameterInfos.get(parameterInfos.size() - 1);
        return createExpression(
            stepDefinition.getPattern(),
            parameterInfo.getTypeResolver()::resolve,
            parameterInfo.isTransposed());
    }
@SuppressWarnings("unchecked")
    @Test
    void table_expression_with_list_type_creates_list_of_ingredients_from_table() {

        registry.defineDataTableType(new DataTableType(Ingredient.class, listBeanMapper(registry)));

        StepDefinition stepDefinition = new StubStepDefinition("Given some stuff:", getTypeFromStepDefinition());
        StepExpression expression = stepExpressionFactory.createExpression(stepDefinition);
        List<Argument> match = expression.match("Given some stuff:", table);

        List<Ingredient> ingredients = (List<Ingredient>) match.get(0).getValue();
        Ingredient ingredient = ingredients.get(0);
        assertThat(ingredient.amount, is(equalTo(2)));
    }