// "Remove 'contains()' check" "true-preview" import java.util.List; class Test { void test(List list, String key) { if(key !=/*nullcheck*/ null && !key./*check*/isEmpty() && /*and*/ list.contains(/*key*/key//line comment )) { list.remove(key); } } }