private synchronized int getAndRotateIndex(int availableContainerCount) {
		if (availableContainerCount <= 0) {
			return 0;
		}
		int i = index % availableContainerCount;
		index = i + 1;
		return i;
	}
Rotate the cached index over the number of available containers.

@param availableContainerCount the number of available containers
@return the current count before rotating
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/admin/deployment/ContainerMatcher.java