case 0:
args = new Object[0];
break;
case 1:
if (!Scenario.class.equals(method.getParameterTypes()[0])) {
throw new CucumberException("When a hook declares an argument it must be of type " + Scenario.class.getName() + ". " + method.toString());
}
args = new Object[]{scenario};
break;
default:
throw new CucumberException("Hooks must declare 0 or 1 arguments. " + method.toString());
}
Utils.invoke(instance, method, timeout, args);
}