title: Using Java Predicate and Lambda
body: <p>Why does the below code return <code>Predicate&lt;String&gt;</code> and not <code>boolean</code>? </p>
  
  <p>My understanding is that the <code>!s.isEmpty()</code> check here is going against the Predicate <code>boolean test(T t);</code> The return type here is <code>boolean</code>. </p>
  
  <p>So in my lambda should my <code>nonEmptyStringPredicate</code> not be of type <code>boolean</code>? Obviously, it's not, I'm just trying to understand why it's not. </p>
  
  <pre><code>Predicate&lt;String&gt; nonEmptyStringPredicate = (String s) -&gt; !s.isEmpty();
  </code></pre>