@Override
	protected boolean matches(Object item, Description mismatchDescription) {
		mismatchDescription.appendText(String.format("failed after %d*%d=%dms:%n", nbAttempts, pause, nbAttempts
				* pause));
		for (int i = 0; i < nbAttempts; i++) {
			boolean result = delegate.matches(item);
			if (result) {
				return true;
			}
			delegate.describeMismatch(item, mismatchDescription);
			mismatchDescription.appendText(", ");
			try {
				Thread.sleep(pause);
			}
			catch (InterruptedException e) {
				Thread.currentThread().interrupt();
				break;
			}
		}
		return false;
	}
A matcher that will evaluate another matcher repeatedly until it matches, or fail after some number of attempts.

@param <U> the type the wrapped matcher operates on

@author Eric Bottard
spring-xd-test-fixtures/src/main/java/org/springframework/xd/test/fixtures/EventuallyMatcher.java