Update to avoid obstacle because next step is not free.

@param nextStep The next step.
@param max The maximum steps.
191834
private void avoidObstacle(int nextStep, int max)
    {
        if (nextStep >= max - 1)
        {
            pathStoppedRequested = true;
        }
        final Collection<Integer> cid = mapPath.getObjectsId(path.getX(nextStep), path.getY(nextStep));
        if (sharedPathIds.containsAll(cid))
        {
            setDestination(destX, destY);
        }
        else
        {
            if (!ignoredIds.containsAll(cid))
            {
                setDestination(destX, destY);
            }
        }
    }
855396
public void setMax(int max)
    {
        this.max = max;
        if (this.max < Alterable.MIN)
        {
            this.max = Alterable.MIN;
        }
        set(cur);
    }
1258867
public void setSteps(java.util.Collection<Step> steps) {
        if (steps == null) {
            this.steps = null;
            return;
        }

        this.steps = new java.util.ArrayList<Step>(steps);
    }
378799
public final void setMaxDragDistance(final float maxDragDistance) {
        if (maxDragDistance != 0) {
            Condition.INSTANCE.ensureGreater(maxDragDistance, threshold,
                    "The maximum drag distance must be greater than " + threshold);
        }

        this.maxDragDistance = maxDragDistance;
    }
1369389
protected synchronized void increment(long now) {
		pointer++;
		if (pointer >= timestamps.length) {
			pointer = 0;
		}
		timestamps[pointer] = now;
		max = now;

		int next = pointer + 1;
		if (next >= timestamps.length) {
			next = 0;
		}
		min = timestamps[next];
	}
1106471
public static void incrementSessionStep(final UIContext uic) {
		int step = uic.getEnvironment().getStep();
		uic.getEnvironment().setStep(step + 1);
	}
710554
public void setMax (BigDecimal max) {
		if (min.compareTo(max) > 0) throw new IllegalArgumentException("min can't be > max");

		this.max = max;

		if (current.compareTo(max) > 0) {
			current = max.setScale(scale, BigDecimal.ROUND_HALF_UP);
			spinner.notifyValueChanged(spinner.isProgrammaticChangeEvents());
		}
	}
637154
function( currentStep, nextStep ) {
            if ( lastEntered === currentStep ) {
                lib.util.triggerEvent( currentStep, "impress:stepleave", { next: nextStep } );
                lastEntered = null;
            }
        }
141199
public void nextStep(O observation, Collection<S> candidates,
            Map<S, Double> emissionLogProbabilities,
            Map<Transition<S>, Double> transitionLogProbabilities) {
        nextStep(observation, candidates, emissionLogProbabilities, transitionLogProbabilities,
                new LinkedHashMap<Transition<S>, D>());
    }
436669
protected synchronized void merge(DoubleMinMax minmax) {
    this.minmax.put(minmax.getMin());
    this.minmax.put(minmax.getMax());
  }
159161
public void nextStep() {
        if (currentStepIndex >= getWidgetCount() - 1) {
            CompleteEvent.fire(MaterialStepper.this, currentStepIndex + 1);
        } else {
            Widget w = getWidget(currentStepIndex);
            if (w instanceof MaterialStep) {
                MaterialStep step = (MaterialStep) w;
                step.setActive(false);

                step.setSuccessText(step.getDescription());

                // next step
                int nextStepIndex = getWidgetIndex(step) + 1;
                if (nextStepIndex >= 0) {
                    for (int i = nextStepIndex; i < getWidgetCount(); i++) {
                        w = getWidget(i);
                        if (!(w instanceof MaterialStep)) {
                            continue;
                        }
                        MaterialStep nextStep = (MaterialStep) w;
                        if (nextStep.isEnabled() && nextStep.isVisible()) {
                            nextStep.setActive(true);
                            setCurrentStepIndex(i);
                            NextEvent.fire(MaterialStepper.this);
                            break;
                        }
                    }
                }
            }
        }
    }
1261671
public void awaitNextIncrements(long nextIncrements) throws InterruptedException
  {
    if (nextIncrements <= 0) {
      throw new IllegalArgumentException("nextIncrements is not positive: " + nextIncrements);
    }
    if (nextIncrements > MAX_COUNT / 4) {
      throw new UnsupportedOperationException("Couldn't wait for so many increments: " + nextIncrements);
    }
    awaitCount((sync.getCount() + nextIncrements) & MAX_COUNT);
  }
196327
private void onEndStepProgress(Object source)
    {
        // Try to find the right step based on the source
        DefaultJobProgressStep step = findStep(this.currentStep, source);

        if (step == null) {
            LOGGER.warn("Could not find any matching step for source [{}]. Ignoring EndStepProgress.",
                source.toString());

            return;
        }

        this.currentStep = step;
        this.currentStep.finish();
    }
864577
public synchronized void setMax(int max) {
        if (max < 0) {
            max = 0;
        }
        if (max != mMax) {
            mMax = max;
            postInvalidate();

            if (mProgress > max) {
                mProgress = max;
            }
            refreshProgress(android.R.id.progress, mProgress, false);
        }
    }
1336767
private void takeNextStep(int lastStep, int nextStep)
    {
        if (!pathStoppedRequested)
        {
            removeObjectId(path.getX(lastStep), path.getY(lastStep));
            assignObjectId(path.getX(nextStep), path.getY(nextStep));
        }
    }
597349
public void setMax(int max) {
    if (max <= 0 || max < mProgress) {
      throw new IllegalArgumentException(
          String.format("Max (%d) must be > 0 and >= %d", max, mProgress));
    }
    mMax = max;
    invalidate();
  }
624021
public void setMaxDepth(int maxDepth) {
		this.maxDepth = maxDepth > UNLIMITED_DEPTH ? maxDepth : UNLIMITED_DEPTH;
		getConfig().setProperty(SPIDER_MAX_DEPTH, Integer.toString(this.maxDepth));

	}