it's my first time I ask here question.

I wanna make ArrayList with 10 unique int numbers from 0 to 9. 
I do next steps:

1. Create empty Arraylist
2. Add first random number, so I can check for repetition later
3. Next I create new random int value, check if I've already have this one in ArrayList. If I have - I try another number, if I have not - I add this number.
4. If I got 10 numbers, I stop the loop

My code:

```
public static void main(String[] args) {

    Random rd = new Random();
    ArrayList<Integer> list = new ArrayList<Integer>();

    int q = rd.nextInt(10);
    list.add(q);

    while (true) {
        int a = rd.nextInt(10);
        for (int b=0;b<list.size();b++){
            if (a == list.get(b)) break;
            else list.add(a);
        }
        if (list.size() == 10) break;
    }
    System.out.println(list);
}

```

But all I see in console is endless process.

The question is - is there another way to make ArrayList with 10 unique numbers (0 to 9)?