### Question:
Condition { public static BaseCondition c(String field, String operator, Object comparison) { return c(field, WhereOperator.toOperator(operator), comparison); } private  Condition(); static BaseCondition c(String field, String operator, Object comparison); static BaseCondition c(String field, WhereOperator whereOperator, Object comparison); static BaseCondition and(BaseCondition... conditions); static BaseCondition or(BaseCondition... conditions); static BaseCondition not(BaseCondition c); static BaseCondition equals(String field, Object value);  }### Answer:
@Test public void testSimpleConditions() { BasicObject object = new BasicObject(); object.setIntValue(10); assertTrue(c("intValue", "=", 10).evaluate(object)); assertTrue(c("intValue", ">", 9).evaluate(object)); assertTrue(c("intValue", ">=", 9).evaluate(object)); assertTrue(c("intValue", ">=", 10).evaluate(object)); assertTrue(c("intValue", "<", 11).evaluate(object)); assertTrue(c("intValue", "<=", 11).evaluate(object)); assertTrue(c("intValue", "<=", 10).evaluate(object)); assertTrue(c("intValue", "!=", 5).evaluate(object)); assertTrue(c("intValue", "IN", Arrays.asList(9, 10, 11)).evaluate(object)); assertFalse(c("intValue", "IN", Arrays.asList(9, 11)).evaluate(object)); }
@Test public void testParentRef() { Parent parent = new Parent("parent"); yawp.save(parent); Child child = new Child("child", parent.getId()); yawp.save(child); Grandchild grandchild = new Grandchild("grandchild", child.getId()); yawp.save(grandchild); BaseCondition c = c("parent->parent->name", "=", "parent"); c.init(yawp, Grandchild.class); assertTrue(c.evaluate(grandchild)); assertTrue(c.evaluate(child)); assertTrue(c.evaluate(parent)); }
@Test public void testIgnoreConditionForChildFields() { Parent parent = new Parent("parent"); yawp.save(parent); Child child = new Child("child", parent.getId()); yawp.save(child); Grandchild grandchild = new Grandchild("grandchild", child.getId()); grandchild.setAge(10); yawp.save(grandchild); BaseCondition c = c("age", "=", 11); c.init(yawp, Grandchild.class); assertFalse(c.evaluate(grandchild)); assertTrue(c.evaluate(child)); assertTrue(c.evaluate(parent)); }