NamedSelector selector = new NamedSelector(selectorName("tableA"));
Constraint constraint = parser.parseConstraint(tokens("tableA.id NOT BETWEEN 'lower' AND 'upper'"), typeSystem, selector);
assertThat(constraint, is(instanceOf(Not.class)));
constraint = ((Not)constraint).getConstraint();
assertThat(constraint, is(instanceOf(Between.class)));
Between between = (Between)constraint;
assertThat(between.isLowerBoundIncluded(), is(true));
assertThat(between.isUpperBoundIncluded(), is(true));
assertThat(between.getOperand(), is(instanceOf(PropertyValue.class)));
PropertyValue operand = (PropertyValue)between.getOperand();
assertThat(operand.selectorName(), is(selector.name()));
assertThat(operand.getPropertyName(), is("id"));
assertThat(between.getLowerBound(), is(instanceOf(Literal.class)));
assertThat(between.getLowerBound(), is(instanceOf(Literal.class)));
assertThat((Literal)between.getLowerBound(), is(literal("lower")));
assertThat((Literal)between.getUpperBound(), is(literal("upper")));
}