Have a look at line three of the Command code:
3 this.id = ++Command.NextID;
This entire algorithm hinges on the fact that the 'threads' are uniquely numbered. The line above is where they are numbered. That line is probably not atomic. If that line is not atomic, two 'threads' could end up with the same number.
I don't think it is possible to prove that the above line is atomic because it depends on the interpreter (you could prove it for one interpreter but not all). Therefore, this example would appear to be broken, or am I just nuts?