OrderedTask extends Task implements Serializable { @Override public void validateParameters() { Set<String> uniqueIds = new HashSet<>(); for (Step step : steps) { uniqueIds.add(step.getIdentifier()); } if (uniqueIds.size() != steps.size()) { throw new InvalidTaskException("OrderedTask has steps with duplicate ids"); } } 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(expected = Task.InvalidTaskException.class) public void testValidateParametersDuplicate() throws Exception { Task invalidTask = new OrderedTask("id", stepOne, stepTwo, stepOneDupe); invalidTask.validateParameters(); }
@Test public void testValidateParametersValid() throws Exception { testTask.validateParameters(); }