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?
List<Object> data = new LinkedList<Object>();
FooBar obj = new FooBar();
data.add(obj);
if (data.contains(FooBar.class)) {
// true
}