title: Collection.sort/reverse/reverOrder
body: <p>I have an Arraylist of songs which store title, artist and time
  I have all my code written up and everything. I just wanted to know more about Collection.sort and Collection.reverse and Collection.reverseOrder. I have a file that has all the songs and everything. 
  I want to sort the songs according to descending order according to time. </p>
  
  <p>When I try this I either get an error or it doesnt sort properly. can anyone suggest how I 
  cant use Collection.sort and use the comparator</p>
  
  <pre><code>Comparator&lt;Song&gt; comparator = Collections.reverseOrder();
  Collections.reverse(listOfSongs);
  </code></pre>
  
  <p>My compare method is as follows:</p>
  
  <pre><code>public int compare(Song mySong1,Song mySong2 ){
          if (mySong1.getLength() &gt; mySong2.getLength()){
              return -1; 
          }
          if(mySong1.getLength() &lt; mySong2.getLength()){
              return 1;
          }
          if(mySong1.getLength() == mySong2.getLength())
          {
              if(mySong1.getTitle().compareTo(mySong2.getTitle()) &gt; 0){
                  return -1;
              }
              if(mySong1.getTitle().compareTo(mySong2.getTitle())  &lt; 0 ){
                  return 1;
              }
              else {
                  if(mySong1.getComposer().compareTo(mySong2.getComposer())  &gt;0){
                      return -1;
                  }
                  if(mySong1.getComposer().compareTo(mySong2.getComposer())  &lt;0) {
                      return 1;
                  }
              }
          }
          return 0; 
      }
  </code></pre>