public int getNumberOfSteps ( ) { int result = 0 ; final Queue < TraceStep > queue = new LinkedList <> ( ) ; queue . add ( root ) ; while ( ! queue . isEmpty ( ) ) { final TraceStep currentTraceStep = queue . poll ( ) ; result ++ ; final List < TraceStep > children = currentTraceStep . getChildren ( ) ; if ( ! children . isEmpty ( ) ) { queue . addAll ( children ) ; } } return result ; }
Calculates the number of steps .