TraverseState state;
Tensor current;
while ((state = iterator.next()) != null) {
if (state != TraverseState.Leaving)
continue;
current = iterator.current();
if (current instanceof Product && indicator.is(current))
iterator.set(expandProductOfSums(current, indicator, transformations));
else if (current instanceof Power && current.get(0) instanceof Sum
&& TensorUtils.isNatural(current.get(1)) && indicator.is(current))
iterator.set(expandPower((Sum) current.get(0), ((Complex) current.get(1)).getReal().intValue(), transformations));