random.setSeed(seed);
Solver solver = new Solver();
int[][] domains = DomainBuilder.buildFullDomains(1, -5, 5, random, random.nextDouble(), random.nextBoolean());
IntVar o = VariableFactory.bounded("o", domains[0][0], domains[0][domains[0].length - 1], solver);
IntVar v = VariableFactory.offset(o, 2);
DisposableValueIterator vit = v.getValueIterator(true);
while (vit.hasNext()) {
Assert.assertTrue(o.contains(vit.next() - 2));
}
vit.dispose();
vit = v.getValueIterator(false);
while (vit.hasPrevious()) {
Assert.assertTrue(o.contains(vit.previous() - 2));
}
vit.dispose();
DisposableRangeIterator rit = v.getRangeIterator(true);
while (rit.hasNext()) {
Assert.assertTrue(o.contains(rit.min() - 2));
Assert.assertTrue(o.contains(rit.max() - 2));
rit.next();