void () { assertTrue(empty().bitwiseAnd(all()).isEmpty()); assertTrue(all().bitwiseAnd(empty()).isEmpty()); assertEquals(all(), all().bitwiseAnd(all())); assertEquals("{0, 16}", all().bitwiseAnd(point(16)).toString()); assertEquals("{0, 1}", all().bitwiseAnd(point(1)).toString()); assertEquals("{0..24}: divisible by 8", all().bitwiseAnd(point(24)).toString()); assertEquals("{0..25}: <0, 1> mod 8", all().bitwiseAnd(point(25)).toString()); assertEquals("{Long.MIN_VALUE..Long.MAX_VALUE-1}: even", all().bitwiseAnd(point(-2)).toString()); assertEquals("{Long.MIN_VALUE..9223372036854775805}: <0, 1> mod 4", all().bitwiseAnd(point(-3)).toString()); assertEquals("{Long.MIN_VALUE..9223372036854775804}: divisible by 4", all().bitwiseAnd(point(-4)).toString()); assertEquals(range(0, 15), all().bitwiseAnd(range(10, 15))); assertEquals(range(0, 31), all().bitwiseAnd(range(16, 24))); assertEquals("{Long.MIN_VALUE..9223372036854775804}: divisible by 4", all().bitwiseAnd(point(~1)).bitwiseAnd(point(~2)).toString()); assertEquals("{Long.MIN_VALUE..9223372036854775802}: <0, 2> mod 8", all().mul(point(6), INT64).bitwiseAnd(point(~4)).toString()); assertEquals("{0}", all().shiftLeft(point(4), INT64).bitwiseAnd(point(15)).toString()); checkBitwiseAnd(range(0, 3), range(4, 7), "{0..3}"); checkBitwiseAnd(range(3, 4), range(3, 4), "{0..7}"); // 0,3,4,7 actually checkBitwiseAnd(range(-20, 20), point(8), "{0, 8}"); checkBitwiseAnd(point(3).join(point(5)), point(3).join(point(5)), "{1, 3, 5}"); checkBitwiseAnd(range(-10, 10), range(-20, 5), "{-32..15}"); checkBitwiseAnd(range(-30, -20).join(range(20, 33)), point(-10).join(point(10)), "{-32..-26, 0..54}"); checkBitwiseAnd(range(0, 100).mul(point(6), INT64), point(~4), "{0..1018}: <0, 2> mod 8"); checkBitwiseAnd(range(0, 50).mul(point(6), INT64), range(0, 50).mul(point(20), INT64).plus(point(1), INT64), "{0..508}: divisible by 4"); }