@Override
    public void execute(TestCaseState state) {
        Object[] args;
        if (method.getParameterTypes().length == 1) {
            args = new Object[] { new io.cucumber.java.Scenario(state) };
        } else {
            args = new Object[0];
        }

        invokeMethod(args);
    }
@Test
    void can_create_with_single_scenario_argument() throws Throwable {
        Method method = JavaHookDefinitionTest.class.getMethod("single_argument", Scenario.class);
        JavaHookDefinition definition = new JavaHookDefinition(method, "", 0, lookup);
        definition.execute(state);
        assertTrue(invoked);
    }