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 creates_a_step_expression() {
        StepDefinition stepDefinition = new StubStepDefinition("Given a step");
        StepExpression expression = stepExpressionFactory.createExpression(stepDefinition);
        assertThat(expression.getSource(), is("Given a step"));
        assertThat(expression.getExpressionType(), is(CucumberExpression.class));
        assertThat(expression.match("Given a step"), is(emptyList()));
    }