title: Search method always null
body: <p>I'm having issues with a method I've written to search a class called Item. No matter what I search, it is returning null. I believe I'm having issues with variable scope:</p>
  
  <pre><code>public Item search(String itemSearch) {
       Item search = null;
       for(Item i : items){
          if (i.getName() == itemSearch){
          search = i;
          }
       }
       return search;
    }
  </code></pre>
  
  <p>The getName method returns the name attribute of the item. No matter what the Item search is always null, I'm guessing this is due to variable scope and it is not assigning in the for each loop? Why is this method always null?</p>
  
  <p>Thank you</p>