private static void waitForCondition(BooleanSupplier condition, boolean failOnTimeout,
			Supplier<String> failureMessageSupplier) throws AssertionFailedError {

		int totalTime = 0;
		while (totalTime <= DEFAULT_WAIT_TIMEOUT) {

			if (condition.getAsBoolean()) {
				return; // success
			}

			totalTime += sleep(DEFAULT_WAIT_DELAY);
		}

		if (!failOnTimeout) {
			return;
		}

		String failureMessage = "Timed-out waiting for condition";
		if (failureMessageSupplier != null) {
			failureMessage = failureMessageSupplier.get();
		}

		throw new AssertionFailedError(failureMessage);
	}
Waits for the given condition to return true. Most of the <code>waitForCondition()</code>
methods throw an {@link AssertionFailedError} if the timeout period expires. This method
allows you to setup a longer wait period by repeatedly calling this method.

<P>
Most clients should use {@link #waitForCondition(BooleanSupplier)}.

@param supplier the supplier that returns true when satisfied
Ghidra/Framework/Generic/src/main/java/generic/test/AbstractGTest.java