title: How to test if a certain object is inside a list
body: <p>Im adding a POJO to a linked list and now I want to check if the list contains that object. The code below does not work, any suggestions? </p>
  
  <pre><code>List&lt;Object&gt; data = new LinkedList&lt;Object&gt;();
  
  FooBar obj = new FooBar();
  
  data.add(obj);
  
  if (data.contains(FooBar.class)) {
      // true
  }
  </code></pre>