One way is to create a list of number from 0-499
List<Integer> nums = new LinkedList<Integer>();
for(int i=0; i<=499; i++) nums.add(i);
Then shuffle the the list
Collections.shuffle(nums);
Then each time you need a non-recurring random number between 0-499, just remove an element from the list
int x = nums.remove()