* <p>await.</p>
*/
public void await() {
try {
try {
final Duration maxWaitTime = conditionSettings.getMaxWaitTime();
final long timeout = maxWaitTime.getValue();
final boolean finishedBeforeTimeout;
if (maxWaitTime == Duration.FOREVER) {
latch.await();
finishedBeforeTimeout = true;
} else if (maxWaitTime == Duration.SAME_AS_POLL_INTERVAL) {
throw new IllegalStateException("Cannot use 'SAME_AS_POLL_INTERVAL' as maximum wait time.");
} else {
finishedBeforeTimeout = latch.await(timeout, maxWaitTime.getTimeUnit());
}
if (throwable != null) {
throw throwable;
} else if (!finishedBeforeTimeout) {
final String maxWaitTimeLowerCase = maxWaitTime.getTimeUnitAsString();
final String message;
if (conditionSettings.hasAlias()) {
message = String.format("Condition with alias '%s' didn't complete within %s %s because %s.",
conditionSettings.getAlias(), timeout, maxWaitTimeLowerCase, Introspector.decapitalize(getTimeoutMessage()));
} else {