System.currentTimeMillis() doesn't give enough randomness when called
sequentially on modern computers. Replacing it with System.nanoTime()
and adding unit test.