Shouldn't we check `dir.exists()` after calling `dir.mkdirs()`? We shouldn't throw an exception if someone else created the directory for us. 

BTW, it should be easy enough to reproduce the race with a single JVM if the test called `mkdirs()` directly from another thread, regardless of the `synchronized` block. So I don't think it's that useful either.