title: Filter prime numbers from stream of BigIntegers
body: <p>How to filter prime numbers from a stream of BigIntegers in java without using isProbablePrime() function ?</p>
  
  <p>I tried this code but cannot solve the error:</p>
  
  <pre><code>List&lt;BigInteger&gt; x =bigIntList.stream().filter(n-&gt;n &gt;1 &amp;&amp; IntStream.range(2,n).noneMatch(index-&gt;n%index==0)).collect(Collectors.toList());
  </code></pre>