OrderedTask extends Task implements Serializable { @Override public TaskProgress getProgressOfCurrentStep(Step step, TaskResult result) { int current = step == null ? -1 : steps.indexOf(step); return new TaskProgress(current, steps.size()); } 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 testGetProgressOfCurrentStep() throws Exception { Task.TaskProgress progress = testTask.getProgressOfCurrentStep(stepOne, null); assertEquals("Current is accurate for first step (0)", 0, progress.getCurrent()); progress = testTask.getProgressOfCurrentStep(stepTwo, null); assertEquals("Current is accurate for second step (1)", 1, progress.getCurrent()); assertEquals("Total is accurate for task", 3, progress.getTotal()); }