assertTrue(c5.isRightInfinity());
}
public void testRangeCardinality() throws Throwable
{
Cardinality c1 = Cardinality.fromString("5..10");
assertTrue(c1.isInRange(5));
assertTrue(c1.isInRange(7));
assertTrue(c1.isInRange(10));
assertFalse(c1.isInRange(-1));
assertFalse(c1.isInRange(3));
assertFalse(c1.isInRange(20));
assertFalse(c1.isInRange(Cardinality.INFINITY));
Cardinality c2 = Cardinality.ZERO_TO_MANY;
assertFalse(c2.isInRange(-1));
assertTrue(c2.isInRange(0));
assertTrue(c2.isInRange(Integer.MAX_VALUE));
Cardinality c3 = Cardinality.ONE_TO_MANY;
assertFalse(c3.isInRange(-1));
assertFalse(c3.isInRange(0));
assertTrue(c3.isInRange(1));
assertTrue(c3.isInRange(Integer.MAX_VALUE));
Cardinality c4 = Cardinality.createCardinality(Cardinality.INFINITY, Cardinality.INFINITY);
assertFalse(c4.isInRange(-1));
assertFalse(c4.isInRange(0));
assertFalse(c4.isInRange(1));
assertFalse(c4.isInRange(10));
assertFalse(c4.isInRange(Integer.MAX_VALUE));
}