when(candidate1.createMatchedStep(stepAsString, parameters)).thenReturn(step1);
when(candidate2.createMatchedStep(stepAsString, parameters)).thenReturn(step2);
when(candidate3.createMatchedStep(stepAsString, parameters)).thenReturn(step3);
when(candidate4.createMatchedStep(stepAsString, parameters)).thenReturn(step4);
StepCollector stepCollector = new MarkUnmatchedStepsAsPending(new StepFinder(new ByLevenshteinDistance()));
List<Step> steps = stepCollector.collectScenarioSteps(asList(steps1, steps2),
new Scenario(asList(stepAsString)), parameters);
// Then the step with highest priority is returned
assertThat(step4, equalTo(steps.get(0)));