title: Linked list : Method to verify if the list contains an element?
body: <p>I am writing a method that is suposed to return TRUE if the element in the linked list or FALSE if it's not in the list.</p>
  
  <p>I was wondering if there was a much more neater way to code this ...</p>
  
  <p>Here's a quick view of my code : </p>
  
  <pre><code>public boolean estElement(T item) {
      boolean elmExist = false;
      this.actual = this.head;
  
      if (item != null &amp;&amp; this.actual != null) {
          T elmSearch;
  
          while (this.actual != null &amp;&amp; !elmExist) {
              elmSearch = actual.getElement();
              if (elmSearch.equals(item)) {
                  elmExist = true;
              } else {
                  this.actual = this.actual.nextLink();
              }
          }           
      }
  
      return elmExist;
  }
  </code></pre>