title: Using binarySearch with Comparator and regex
body: <p>I am trying to write a quick search that searches a <code>List&lt;String&gt;</code> 
  Instead of looping through the list and manually checking, I want to do this using binarySearch, but I am not sure how to do it.</p>
  
  <p>Old way:</p>
  
  <pre><code>for(String s : list) {
    if(s.startsWith("contact.")
       return true;
  }
  </code></pre>
  
  <p>Instead I would like something like this:</p>
  
  <pre><code>Collections.sort(list);
  Collections.binarySearch(list, FindContactComparator());
  </code></pre>
  
  <p>Can someone help me write this Comparator? <br/>
  Is there any better way of doing this instead of using binarySearch?</p>