private void assertSavedContainer(String id, ContainerAttributes containerAttributes) {
		long timeout = System.currentTimeMillis() + 15000;
		boolean foundContainer = false;
		while (!foundContainer && System.currentTimeMillis() < timeout) {
			try {
				Thread.sleep(200);
				Container container = containerRepository.findOne(id);
				if (container != null && compareContainerAttributes(container.getAttributes(), containerAttributes)) {
					foundContainer = true;
				}
			}
			catch (InterruptedException e) {
				Thread.currentThread().interrupt();
				break;
			}
		}
		assertTrue("Container repository is not updated with the test containers", foundContainer);
	}
Assert if the saved container exists in the {@link ContainerRepository}

@param id the containerId
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/listener/ZooKeeperContainerRepositoryTests.java