title: JPA Criteria API "IN" Predicate not working
body: <p>I need to write the following with JPA Criteria API:</p>
  <pre><code>p.id IS NULL  AND   nv.organizationalstat IN ('EMPLOYEE', 'FELLOW')`
  </code></pre>
  <p>My code is:</p>
  <pre><code> List&lt;String&gt; corePredicateInList = Arrays.asList(&quot;EMPLOYEE&quot;, &quot;FELLOW&quot;);
   In&lt;String&gt; corePredicateIn = cb.in(nvRoot.get(&quot;organizationalstat&quot;));
   corePredicateInList.forEach(p -&gt; corePredicateIn.value(p)); // Setting opts into IN
   Predicate p1CorePredicate = cb.and( 
                                  cb.isNull(plans.get(&quot;id&quot;)), 
                                  cb.in(nvRoot.get(&quot;organizationalstat&quot;), corePredicateIn)
                              );
  </code></pre>
  <p>The runtime error is</p>
  <pre><code>antlr.NoViableAltException: unexpected token: in
  ...
  where ( ( ( ( ( ( generatedAlias0.id is null ) 
    and ( generatedAlias1.organizationalstat in (:param0, :param1) in () ) ) 
    or ( generatedAlias0.id is not null ) )
  </code></pre>
  <p>It looks like there's a double IN somewhere. There are no syntax errors in the code.</p>
  <p>I can't do <code>cb.in(List&lt;String&gt;)</code> directly, that's wrong syntax. I have to go through <code>in.value()</code> as <a href="https://stackoverflow.com/a/9323183/1005607">indicated</a> in this thread.</p>