contains
just check if an object is present in the List. So you can't do a case insensitive lookup here, because "three" is a different object than "Three".
A simple approach to solve this would be
public boolean containsCaseInsensitive(String s, List<String> l){
for (String string : l){
if (string.equalsIgnoreCase(s)){
return true;
}
}
return false;
}
and then
containsCaseInsensitive("three", data);
Java 8+ version:
public boolean containsCaseInsensitive(String s, List<String> l){
return l.stream().anyMatch(x -> x.equalsIgnoreCase(s));
}