Java get First and Last duplicate elements of List : <p><br>
In my application i want to get first and repetitive elements from array
eg,</p>

<pre><code>String[] strings = {"one", "one", "one", "one", "one", "one", "one", "one", "one", "one", "one", "one"
                , "two", "two", "two", "two", "two", "two", "two", "two", "two", "two", "two", "two", "two", "two", "two"
                , "three", "three", "three", "three", "three", "three", "three", "three", "three", "three", "three"
                , "four", "four", "four", "four", "four", "four", "four", "four", "four", "four"
                , "five", "five", "five", "five", "five", "five"
                , "six", "six", "six", "six", "six", "six", "six", "six", "six"
                , "seven", "seven", "seven", "seven", "seven", "seven", "seven", "seven"
                , "eight", "eight", "eight", "eight", "eight", "eight"
                , "nine", "nine", "nine", "nine", "nine", "nine", "nine", "nine", "nine"
                , "ten", "ten", "ten", "ten", "ten", "ten", "ten", "ten", "ten"};
</code></pre>

<p>for the above list i want to get output like<br><br>
one<br>
one<br>
two<br>
two<br>
three<br>
three<br>
four<br>
four<br>
five<br>
five<br>
six<br>
six<br>
seven<br>
seven<br>
eight<br>
eight<br>
nine<br>
nine<br>
ten<br>
ten<br></p>
