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());
    }
@Test
    void table_expression_with_type_creates_single_ingredients_from_table() {

        registry.defineDataTableType(new DataTableType(Ingredient.class, beanMapper(registry)));
        StepDefinition stepDefinition = new StubStepDefinition("Given some stuff:", Ingredient.class);
        StepExpression expression = stepExpressionFactory.createExpression(stepDefinition);
        List<Argument> match = expression.match("Given some stuff:", tableTransposed);

        Ingredient ingredient = (Ingredient) match.get(0).getValue();
        assertThat(ingredient.name, is(equalTo("chocolate")));
    }