If `stat == null` this will always sleep. However if `create == false` then `stat == null` is the condition you're actually looking for so it doesn't make sense to sleep in that case.

If you agree, I can change the try block to look like this:
```
try {
	int attempts = 0;
	Stat stat = client.checkExists().forPath(path);

	while (((create && stat == null) || (!create && stat != null)) && ++attempts < TIMEOUT / 100) {
		Thread.sleep(100);
		stat = client.checkExists().forPath(path);
	}
}
```
Let me know if this looks right to you.