This is very nice: 
http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/RandomStringUtils.html - something like RandomStringUtils.randomNumeric(7). 
There are 10^7 equiprobable (if java.util.Random is not broken) distinct values so uniqueness may be a concern.