this.currLevel = level;
}
//Case where we continue on with part of old branch
else if (level == this.currLevel)
{
TestPath oldBranch = new TestPath();
for (TestCondition cond : this.currBranch.conditions)
{
oldBranch.conditions.add(cond);
}
this.currBranchList.add(oldBranch);
//Remove last condtion so we have room for alternate branch
this.currBranch.conditions.remove(this.currBranch.conditions.size() - 1);
//Add new condtion
this.currBranch.conditions.add(testCondition);
}
else
{
//Keep reference of last branch
TestPath lastBranch = currBranch;
//Save the current branch
this.currBranchList.add(currBranch);
//Create a new branch
this.currBranch = new TestPath();
//Add back in the last branch conds
for (int i = 0; i < level; i++)
{
this.currBranch.conditions.add(lastBranch.conditions.get(i));