if (condition.test()) { // -> STABILITY_WAIT
state = STABILITY_WAIT;
stabilityTime = time + getStabilityTimeout();
logger.info("Ensuring stable state ...");
} else if (time > maxTime) { // ERROR
throw new TimeoutException();
}
} else {
if (!condition.test()) { // -> WAIT
state = WAIT;
logger.info("Waiting again ...");
} else if (time > stabilityTime) { // SUCCESS
break;
} else if (time > maxTime) { // ERROR
throw new TimeoutException();
}
}
try {
Thread.sleep(TIME_STEP);
} catch (InterruptedException e) {