This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Are you using truly random numbers (which entail possible duplications) or do you want random sampling from a diminishing population, in which case your values will be unique? For random sampling from a diminishing population, put values into a List (probably via a Set to avoid duplicates) and remove the value selected; the List will gradually become smaller, so your random numbers must be chosen from a diminishing range.
Alternative: shuffle a List and choose the first n values.
Remember the Random class and Math.random() are not truly random, but do present possible duplications. If you use Math.random() long enough, you are guaranteed to receive duplicate values.
username + username.hashCode() is just as unique as username is. username.hashCode will always return the same thing for the same value of username, so you might as well have written username + 42 or simply username.