title: how to compare two dates in stream filter in java 8?
body: <p>I get two dates from a request object using stream filter. There I have to compare those objects then collect them store in list. But now i get this error. Please help me with it.</p>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>Type mismatch: cannot convert from int to boolean</p>
  </blockquote>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>Date checkIn = req.getCheckIn();
  Date checkOut = req.getCheckOut();
  
  List&lt;PlaceBook&gt; filtered = checkInVal.stream().filter(string -&gt; 
              string.getCheckInDt().compareTo(checkIn)).collect(Collectors.toList());
  </code></pre>