title: incompatible types: Predicate<CAP#1> cannot be converted to Predicate<? super CAP#2>
body: <p>Here is my code.</p>
  
  <pre><code>import java.util.stream.Stream;
  import java.util.List;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.function.Predicate;
  
  public class StreamMethod{
      public static void main(String... args){
          List&lt;Integer&gt; data = new ArrayList&lt;Integer&gt;(Arrays.asList(1,2,3,4,5,6,7,8));
  
          allMatch(data, x -&gt; x &lt; 10);
      }
  
      public static &lt;T&gt; void allMatch(List&lt;?&gt; list, Predicate&lt;? super T&gt; predicate){
          boolean allSatisfy = list.stream().allMatch(predicate);
          System.out.println(allSatisfy);
      }
  }
  </code></pre>
  
  <p>I'm getting the error <code>incompatible types: Predicate&lt;CAP#1&gt; cannot be converted to Predicate&lt;? super CAP#2&gt;</code> . Can you help me to solve it? and why it is showing this error?</p>
  
  <p>Then I also change the above lines of passing arguments as</p>
  
  <pre><code>Predicate&lt;Integer&gt; pred= x -&gt; x &lt; 10;
  allMatch(data, pred);
  </code></pre>
  
  <p>But still facing the error.</p>