private long exponentialDelay(int attempts, long max) {
		long delay = ((long) Math.pow(2, attempts) - 1) / 2;
		return Math.min(delay, max);
	}
Calculate an exponential delay per the algorithm described
in http://en.wikipedia.org/wiki/Exponential_backoff.

@param attempts number of failed attempts
@param max      the maximum amount of time to wait

@return the amount of time to wait
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/container/ContainerRegistrar.java