void () { assertTrue(empty().negate(INT64).isEmpty()); assertEquals(point(Long.MAX_VALUE), point(Long.MIN_VALUE + 1).negate(INT64)); assertEquals(point(Long.MIN_VALUE), point(Long.MIN_VALUE).negate(INT64)); assertEquals(point(Integer.MIN_VALUE), point(Integer.MIN_VALUE).negate(INT32)); assertEquals(point(Integer.MAX_VALUE + 1L), point(Integer.MIN_VALUE).negate(INT64)); assertEquals(range(-200, -100), range(100, 200).negate(INT64)); assertEquals(range(-200, 1), range(-1, 200).negate(INT64)); assertEquals(range(-200, 200), range(-200, 200).negate(INT32)); assertEquals(range(-200, 201), range(-201, 200).negate(INT32)); assertEquals(all(), all().negate(INT64)); assertEquals(range(100, Integer.MAX_VALUE).join(point(Integer.MIN_VALUE)), range(Integer.MIN_VALUE, -100).negate(INT32)); assertEquals(point(Long.MAX_VALUE).join(point(Long.MIN_VALUE)), range(Long.MIN_VALUE, Long.MIN_VALUE + 1).negate(INT64)); assertEquals(range(100, Integer.MAX_VALUE + 1L), range(Integer.MIN_VALUE, -100).negate(INT64)); LongRangeSet set = range(-900, 1000).subtract(range(-800, -600)).subtract(range(-300, 100)).subtract(range(500, 700)); assertEquals("{-900..-801, -599..-301, 101..499, 701..1000}", set.toString()); assertEquals("{-1000..-701, -499..-101, 301..599, 801..900}", set.negate(INT32).toString()); checkNegate(modRange(-15, 100, 10, 0b1011), "{-100..10}: <0, 7, 9> mod 10", INT64); checkNegate(modRange(-15, 100, 2, 0b10), "{-99..15}: odd", INT32); checkNegate(modRange(0, 200, 64, 0b100), "{-194..-2}: <62> mod 64", INT32); }