title: Why this lambda expression got wrong
body: <p>What is wrong with the following code? <code>list.removeIf(p -&gt; p.contains("hello"));</code></p>
  
  <pre><code>import java.util.*;
  public class NewClass1 {
      public static void main(String[] args) {
          List&lt;String&gt; list = Arrays.asList("hello", " hello world", " hello china", "chi", "hi");
          System.out.println(list);
  
          list.removeIf(p -&gt; p.contains("hello"));
          System.out.println(list);
      }
  }
  </code></pre>