public void addStep(final Step testStep) throws RuntimeException { if (!testSteps.contains(testStep)) { testSteps.add(testStep); testStepsIds.add(testStep.getStepId()); } else throw new EntityExistanceException( "StepId: '" + testStep + "' already exists in this process. StepId has to be unique."); }
public void replaceStep(final Step testStep) throws RuntimeException { if (testSteps.contains(testStep)) { final int stepIndex = testSteps.indexOf(testStep); testSteps.set(stepIndex, testStep); testStepsIds.set(stepIndex, testStep.getStepId()); } else throw new EntityExistanceException( "StepId: '" + testStep + "' doesnt' exists in this process. Step couldn't be replaced."); }