Expression notIn = new ASTNotIn(new ASTObjPath("estimatedPrice"), new ASTList(
new Object[] {
new BigDecimal("10"), new BigDecimal("20")
}));
Painting noMatch1 = new Painting();
noMatch1.setEstimatedPrice(new BigDecimal("21"));
assertFalse(in.match(noMatch1));
assertTrue(notIn.match(noMatch1));
Painting noMatch2 = new Painting();
noMatch2.setEstimatedPrice(new BigDecimal("11"));
assertFalse("Failed: " + in, in.match(noMatch2));
assertTrue("Failed: " + notIn, notIn.match(noMatch2));
Painting match1 = new Painting();
match1.setEstimatedPrice(new BigDecimal("20"));
assertTrue(in.match(match1));
assertFalse(notIn.match(match1));
Painting match2 = new Painting();
match2.setEstimatedPrice(new BigDecimal("10"));
assertTrue("Failed: " + in, in.match(match2));
assertFalse("Failed: " + notIn, notIn.match(match2));
}