@Test
public void testGenerateCriteria_BetweenDate() {

    String lowerDateString = "1/1/2010";
    DateTime lowerDate = DateTime.parse(lowerDateString, formatter).withTimeAtStartOfDay();
    String upperDateString = "1/2/2010";
    DateTime upperDate = DateTime.parse(upperDateString, formatter).withTimeAtStartOfDay();
    Map<String, String> mapCriteria = new HashMap<String, String>();
    mapCriteria.put("prop4", lowerDateString + SearchOperator.BETWEEN.op() + upperDateString);
    QueryByCriteria.Builder qbcBuilder = generator.generateCriteria(TestClass.class, mapCriteria, false);
    assertNotNull(qbcBuilder);
    QueryByCriteria qbc = qbcBuilder.build();
    Predicate and = qbc.getPredicate();
    assertTrue(and instanceof AndPredicate);
    Set<Predicate> predicates = ((AndPredicate) and).getPredicates();
    assertEquals(2, predicates.size());
    boolean foundProp4Lower = false;
    boolean foundProp4Upper = false;
    for (Predicate predicate : predicates) {
        if (predicate instanceof GreaterThanOrEqualPredicate) {
            foundProp4Lower = true;
            GreaterThanOrEqualPredicate greaterThanOrEqual = (GreaterThanOrEqualPredicate) predicate;
            assertEquals(greaterThanOrEqual.getValue().getValue(), lowerDate);
        } else if (predicate instanceof LessThanOrEqualPredicate) {
            foundProp4Upper = true;
            LessThanOrEqualPredicate lessThanOrEqual = (LessThanOrEqualPredicate) predicate;
            assertEquals(lessThanOrEqual.getValue().getValue(), upperDate.plusDays(1));
        }
    }
    assertTrue(foundProp4Lower);
    assertTrue(foundProp4Upper);
}