title: Unexpected results when trying to match string pattern
body: <p>Given a string, return true if the first instance of "x" in the string is immediately followed by another "x". It will not work for the case of doubleX("axxbb"). It should return true but gives false.</p>
  
  <pre><code>boolean doubleX(String str) {
    for (int i = 0; i &lt; str.length(); i++) {
      if (str.substring(i) == "x") {
        if ( str.substring(i) == str.substring(i + 1)){
        return true;
        }
  
      }
  
    }
    return false;
  }
  </code></pre>