Example

public class ClassA {
ArrayList<String> l;
Object o;
String s;
public boolean methodA () {

l.contains(o)
l.contains(s)
}

Solution Reconsider the invocation of l.contains(o). If known that o will be of type String, then downcast it to type String ( ie. (String)o )