private void runStepsWhileKeepingState(RunContext context, List<Step> steps) throws InterruptedException { if (steps == null || steps.size() == 0) { return; } State state = context.state(); for (Step step : steps) { try { context.interruptIfCancelled(); state = state.run(step); } catch (RestartingScenarioFailure e) { reporter.get().restarted(step.toString(), e); throw e; } } context.stateIs(state); }