Is that the idea that since the code should neither invent new values, nor duplicate values, it will always end up returning a permutation?
It seems like inventing values not being possible is fine, but duplicating a value seems very plausible - what safe subset of Java would ensure that doesn't happen?