title: Finding duplicate elements in an arraylist
body: <p>I was wondering if there was a way to find duplicate elements in an arraylist. For more context of what I'm trying to do, I have an arraylist of strings. The strings each contain information about an MP3 file. They have a title, composer, and running time seperated by a '&amp;' character (e.g. Friday&amp;Rebecca Black&amp;666).</p>
  
  <p>The arraylist has already been quicksorted according to the running times. However, I also need to sort the arraylist so that if the running times for songs are equal they should be put into lexicographic order on the title, and then on the composer if the titles are equal as well.</p>
  
  <p>I want to be able to find duplicate running times in the arraylist so that I can use the <code>compareTo</code> method to sort alphabetically like I need to. I have already implemented methods <code>getTime</code>, <code>getTitle</code>, <code>getComposer</code> that extract the relevant information from the overall strings. Is there a way I could do this in a new method such as <code>alphabetical</code>, or even better is there a way I could incorporate it into my quicksort algorithm so I don't have to search through the sorted arraylist again?</p>
  
  <p>Thanks.</p>