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 docstring_expression_transform_doc_string_to_json_node() {
        String docString = "{\"hello\": \"world\"}";
        String contentType = "json";
        registry.defineDocStringType(new DocStringType(
            JsonNode.class,
            contentType,
            (String s) -> objectMapper.convertValue(docString, JsonNode.class)));

        StepDefinition stepDefinition = new StubStepDefinition("Given some stuff:", JsonNode.class);
        StepExpression expression = stepExpressionFactory.createExpression(stepDefinition);
        List<Argument> match = expression.match("Given some stuff:", docString, contentType);
        JsonNode node = (JsonNode) match.get(0).getValue();
        assertThat(node.asText(), equalTo(docString));
    }