Java-I have an ArrayList contains objects, after one occurrence I want the object is added to another list
<p>i have this ArrayList ID that contains objects:</p>

<pre><code>0
10
10
9
8
3
11
6
10
1
7
13
7
7
</code></pre>

<p>After one occurrence of integer, i want that integer is added to another list (example visited) and the checking process stop. How to solve this? Must I change the type ArrayList ID to another java collection?</p>
