title: Check if arraylist is sorted
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3047051/how-to-determine-if-a-list-is-sorted-in-java">How to determine if a List is sorted in Java?</a>  </p>
  </blockquote>
  
  
  
  <p>In java I have array list with names, how do I check if it sorted? I don't want it to be sorted. I just want it to return true if it is and false if it isn't.</p>
  
  <p>So far I have this:</p>
  
  <pre><code>public boolean isSorted()
  {
      boolean check = false;
  
      if (Collection.sort(bank, Bank.getOwner()).equals(bank))
      {
          check = true;
      }
      else
      {
          check = false;
      }      
      return check;
  }
  </code></pre>
  
  <p>Where getOwner returns the owner name. Obviously I'm doing it wrong.</p>