@Test(groups = "1s")
public void test01() {
Solver solver = new Solver();
IntVar v = VariableFactory.enumerated("A", 1, 5, solver);
AntiDomain ad = new AntiDomBitset(v);
Assert.assertFalse(ad.get(1));
Assert.assertFalse(ad.get(2));
Assert.assertFalse(ad.get(3));
Assert.assertFalse(ad.get(4));
Assert.assertFalse(ad.get(5));
solver.getEnvironment().worldPush();
ad.add(1);
ad.add(5);
Assert.assertTrue(ad.get(1));
Assert.assertFalse(ad.get(2));
Assert.assertFalse(ad.get(3));
Assert.assertFalse(ad.get(4));
Assert.assertTrue(ad.get(5));
solver.getEnvironment().worldPush();
ad.add(3);
DisposableValueIterator values = ad.getValueIterator();
while (values.hasNext()) {
Assert.assertTrue(ad.get(values.next()));
}
Assert.assertTrue(ad.get(1));
Assert.assertFalse(ad.get(2));
Assert.assertTrue(ad.get(3));
Assert.assertFalse(ad.get(4));
Assert.assertTrue(ad.get(5));
solver.getEnvironment().worldPop();
Assert.assertTrue(ad.get(1));
Assert.assertFalse(ad.get(2));
Assert.assertFalse(ad.get(3));
Assert.assertFalse(ad.get(4));
Assert.assertTrue(ad.get(5));
solver.getEnvironment().worldPop();
Assert.assertFalse(ad.get(1));
Assert.assertFalse(ad.get(2));
Assert.assertFalse(ad.get(3));
Assert.assertFalse(ad.get(4));
Assert.assertFalse(ad.get(5));
}