OrderedTask extends Task implements Serializable { @Override public Step getStepBeforeStep(Step step, TaskResult result) { int nextIndex = steps.indexOf(step) - 1; if (nextIndex >= 0) { return steps.get(nextIndex); } return null; } OrderedTask(String identifier, List<Step> steps);  OrderedTask(String identifier, Step... steps); @Override Step getStepAfterStep(Step step, TaskResult result); @Override Step getStepBeforeStep(Step step, TaskResult result); @Override Step getStepWithIdentifier(String identifier); @Override TaskProgress getProgressOfCurrentStep(Step step, TaskResult result); @Override String getTitleForStep(Context context, Step step); @Override void validateParameters(); List<Step> getSteps();  }
@Test public void testGetStepBeforeStep() throws Exception { Step previousStep = testTask.getStepBeforeStep(stepThree, null); assertEquals("Returns the previous sequential step in the task", stepTwo, previousStep); previousStep = testTask.getStepBeforeStep(stepOne, null); assertNull("Returns null if passed in step is the first", previousStep); }