/** * If this is a leaf step, total count will be 1 * If this step is a step macro, total count will equal the number of (direct or indirect) leaf step descendants * * @return the total number of steps represented by this StepToken */ public int getTotalStepCountWithDescendants() { int descendantCount = isStepMacro() ? 0 : 1; for ( StepToken c : childSteps) { descendantCount += c.getTotalStepCountWithDescendants(); } return descendantCount; }