void () { checkMul(empty(), empty(), INT64, "{}"); checkMul(empty(), point(0), INT64, "{}"); checkMul(empty(), range(0, 10), INT64, "{}"); checkMul(empty(), range(0, 10).join(range(15, 20)), INT64, "{}"); checkMul(point(5), point(10), INT32, "{50}"); checkMul(point(2_000_000_000), point(2), INT32, "{-294967296}"); checkMul(point(2_000_000_000), point(2), INT64, "{4000000000}"); checkMul(point(Integer.MIN_VALUE), point(Integer.MIN_VALUE), INT32, "{0}"); checkMul(point(Integer.MIN_VALUE), point(Integer.MIN_VALUE), INT64, "{4611686018427387904}"); checkMul(point(1), point(10), INT32, "{10}"); checkMul(point(0), point(10), INT32, "{0}"); checkMul(point(-1), point(10), INT32, "{-10}"); checkMul(point(1), range(10, 20).join(range(30, 40)), INT32, "{10..20, 30..40}"); checkMul(point(0), range(10, 20).join(range(30, 40)), INT32, "{0}"); checkMul(point(-1), range(10, 20).join(range(30, 40)), INT32, "{-40..-30, -20..-10}"); checkMul(point(-1), range(Integer.MIN_VALUE, Integer.MIN_VALUE+30), INT32, "{Integer.MIN_VALUE, 2147483618..Integer.MAX_VALUE}"); checkMul(point(-1), range(Integer.MIN_VALUE, Integer.MIN_VALUE+30), INT64, "{2147483618..2147483648}"); checkMul(point(2), range(10, 20), INT32, "{20..40}: even"); checkMul(point(-2), range(10, 20), INT32, "{-40..-20}: even"); checkMul(point(2), range(-20, -10), INT32, "{-40..-20}: even"); checkMul(point(2), range(Integer.MAX_VALUE - 10, Integer.MAX_VALUE), INT32, "{Integer.MIN_VALUE..Integer.MAX_VALUE-1}: even"); checkMul(point(2), range(Integer.MAX_VALUE - 10, Integer.MAX_VALUE), INT64, "{4294967274..4294967294}: even"); checkMul(point(3), range(-5, 15), INT32, "{-15..45}: divisible by 3"); checkMul(point(3), range(Integer.MAX_VALUE - 10, Integer.MAX_VALUE), INT32, "{Integer.MIN_VALUE..Integer.MAX_VALUE}"); checkMul(point(6), range(Integer.MAX_VALUE - 10, Integer.MAX_VALUE), INT32, "{Integer.MIN_VALUE..Integer.MAX_VALUE-1}: even"); checkMul(point(3), range(Integer.MAX_VALUE - 10, Integer.MAX_VALUE), INT64, "{6442450911..6442450941}: divisible by 3"); checkMul(point(6), range(Integer.MAX_VALUE - 10, Integer.MAX_VALUE), INT64, "{12884901822..12884901882}: divisible by 6"); LongRangeSet mul720 = all().mul(point(5), INT64).mul(point(8), INT64) .mul(point(3), INT64).mul(point(6), INT64); assertEquals("{Long.MIN_VALUE..9223372036854775792}: divisible by 16", mul720.toString()); LongRangeSet mul15 = range(0, 10).mul(point(3), INT64).mul(point(5), INT64); assertEquals("{0..150}: divisible by 15", mul15.toString()); assertEquals("{0..1200}", mul15.mul(point(8), INT64).toString()); assertEquals("{Long.MIN_VALUE..Long.MAX_VALUE-1}: even", point(2).join(point(10)).join(point(100)).mul(all(), INT64).toString()); LongRangeSet even = modRange(Integer.MIN_VALUE, Integer.MAX_VALUE, 2, 1L); assertEquals("{Integer.MIN_VALUE..2147483640}: divisible by 8", point(4).join(point(100)).join(point(1000)).mul( even, INT32).toString()); }