Find series of similar elements in a arraylist
<p>I have a arraylist of type integer. The list contains some values.<br>
At some point the list will contain similar values consecutively (3 values).<br>
I need to find the position at which the 3 similar elements appear.  </p>

<p>For example:</p>

<pre><code>ArrayList&lt;Integer&gt; int_values=new ArrayList&lt;Integer&gt;();
int_values.add(10);
int_values.add(20);
int_values.add(30);
int_values.add(10);
int_values.add(10);
int_values.add(10);
</code></pre>

<p>As can be seen from position 3 to 5 there are similar values.<br>
So I need to retrieve the position 5.<br>
Also this series of similar elements repeating will occur only once.  </p>

<p>I hope I am able to explain the scenario.</p>
