Source:
<code>public void run() { final List<CucumberFeature> features = featureSupplier.get(); bus.send(new TestRunStarted(bus.getTime(), bus.getTimeMillis())); for (CucumberFeature feature : features) { feature.sendTestSourceRead(bus); } final StepDefinitionReporter stepDefinitionReporter = plugins.stepDefinitionReporter(); runnerSupplier.get().reportStepDefinitions(stepDefinitionReporter); final List<PickleEvent> filteredEvents = new ArrayList<>(); for (CucumberFeature feature : features) { for (final PickleEvent pickleEvent : feature.getPickles()) { if (filters.matchesFilters(pickleEvent)) { filteredEvents.add(pickleEvent); } } } final List<Future<?>> executingPickles = new ArrayList<>(); <START> for(final PickleEvent pickleEvent : runtimeOptions.getOrderType().orderPickleEvents(filteredEvents)) { <END> executingPickles.add(executor.submit(new Runnable() { @Override public void run() { runnerSupplier.get().runPickle(pickleEvent); } })); } executor.shutdown(); List<Throwable> thrown = new ArrayList<>(); for (Future executingPickle : executingPickles) { try { executingPickle.get(); } catch (ExecutionException e){ log.error("Exception while executing pickle", e); thrown.add(e.getCause()); } catch (InterruptedException e){ executor.shutdownNow(); throw new CucumberException(e); } } if(thrown.size() == 1){ throw new CucumberException(thrown.get(0)); } else if (thrown.size() > 1){ throw new CompositeCucumberException(thrown); } bus.send(new TestRunFinished(bus.getTime(), bus.getTimeMillis())); }</code><technical_language>Ideally order is injected Runtime builder. This allows other implementations create Runtime instances passing in CLI based RuntimeOptions. This in long run separate parsing of CLI options executing pickles</technical_language>

Target:
public void run() { final List<CucumberFeature> features = featureSupplier.get(); bus.send(new TestRunStarted(bus.getTime(), bus.getTimeMillis())); for (CucumberFeature feature : features) { feature.sendTestSourceRead(bus); } final StepDefinitionReporter stepDefinitionReporter = plugins.stepDefinitionReporter(); runnerSupplier.get().reportStepDefinitions(stepDefinitionReporter); final List<PickleEvent> filteredEvents = new ArrayList<>(); for (CucumberFeature feature : features) { for (final PickleEvent pickleEvent : feature.getPickles()) { if (filters.matchesFilters(pickleEvent)) { filteredEvents.add(pickleEvent); } } } final List<PickleEvent> orderedEvents = pickleOrder.orderPickleEvents(filteredEvents); final List<PickleEvent> limitedEvents = filters.limitPickleEvents(orderedEvents); final List<Future<?>> executingPickles = new ArrayList<>(); for(final PickleEvent pickleEvent : limitedEvents) { executingPickles.add(executor.submit(new Runnable() { @Override public void run() { runnerSupplier.get().runPickle(pickleEvent); } })); } executor.shutdown(); List<Throwable> thrown = new ArrayList<>(); for (Future executingPickle : executingPickles) { try { executingPickle.get(); } catch (ExecutionException e){ log.error("Exception while executing pickle", e); thrown.add(e.getCause()); } catch (InterruptedException e){ executor.shutdownNow(); throw new CucumberException(e); } } if(thrown.size() == 1){ throw new CucumberException(thrown.get(0)); } else if (thrown.size() > 1){ throw new CompositeCucumberException(thrown); } bus.send(new TestRunFinished(bus.getTime(), bus.getTimeMillis())); }