user
Write a Java function which takes in a list and a string and returns true if the string is contained in the list, otherwise false.

list: [“apple”, “banana”, “pear”], string: “pear”


assistant
public boolean containsString(List<String> list, String s) { 
    return list.contains(s); 
}