@Test
public void testGetPredicateForInClauseTwoChunks()
{

    // Create the JPA builder, query, and entity root.
    CriteriaBuilder builder = entityManager.getCriteriaBuilder();
    CriteriaQuery<BusinessObjectDataEntity> criteria = builder.createQuery(BusinessObjectDataEntity.class);
    Root<BusinessObjectDataEntity> businessObjectDataEntity = criteria.from(BusinessObjectDataEntity.class);
    // Get the predicate for the "in" clause with 1001 values (1 greater than the default chunking size).
    Predicate predicate = baseJpaDaoImpl
        .getPredicateForInClause(builder, businessObjectDataEntity.get(BusinessObjectDataEntity_.partitionValue), getPartitionValueList(1001));
    // We expect to get back an "or" of 2 "in" expressions where each "in" expression is a list of chunked partition values.
    assertEquals(Predicate.BooleanOperator.OR, predicate.getOperator());
    List<Expression<Boolean>> expressions = predicate.getExpressions();
    assertEquals(2, expressions.size());
    // The first "in" clause will have the first 1000 elements and the second "in" clause will have the extra "1" element.
    assertEquals(1000, ((InPredicate) expressions.get(0)).getValues().size());
    assertEquals(1, ((InPredicate) expressions.get(1)).getValues().size());
}