@Test(groups = "1s")
public void test02() {
Solver solver = new Solver();
IntVar v = VariableFactory.enumerated("A", 1, 10, solver);
AntiDomain ad = new AntiDomInterval(v);
for (int i = 1; i < 11; i++) {
Assert.assertFalse(ad.get(i));
}
solver.getEnvironment().worldPush();
ad.updateLowerBound(1, 4);
ad.updateLowerBound(4, 5);
ad.updateUpperBound(10, 7);
Assert.assertTrue(ad.get(1));
Assert.assertTrue(ad.get(2));
Assert.assertTrue(ad.get(3));
Assert.assertTrue(ad.get(4));
Assert.assertFalse(ad.get(5));
Assert.assertFalse(ad.get(6));
Assert.assertFalse(ad.get(7));
Assert.assertTrue(ad.get(8));
Assert.assertTrue(ad.get(9));
Assert.assertTrue(ad.get(10));
solver.getEnvironment().worldPush();
DisposableValueIterator values = ad.getValueIterator();
while (values.hasNext()) {
Assert.assertTrue(ad.get(values.next()));
}
solver.getEnvironment().worldPop();
Assert.assertTrue(ad.get(1));
Assert.assertTrue(ad.get(2));
Assert.assertTrue(ad.get(3));
Assert.assertTrue(ad.get(4));
Assert.assertFalse(ad.get(5));
Assert.assertFalse(ad.get(6));
Assert.assertFalse(ad.get(7));
Assert.assertTrue(ad.get(8));
Assert.assertTrue(ad.get(9));
Assert.assertTrue(ad.get(10));
solver.getEnvironment().worldPop();
for (int i = 1; i < 11; i++) {
Assert.assertFalse(ad.get(i));
}
}