void () { assertEquals("{1}", point(1).join(empty()).toString()); assertEquals("{1}", empty().join(point(1)).toString()); assertEquals("{1}", point(1).join(point(1)).toString()); assertEquals("{1, 2}", point(2).join(point(1)).toString()); assertEquals("{1, 2}", point(1).join(point(2)).toString()); assertEquals("{1, 3}", point(1).join(point(3)).toString()); assertEquals("{1, 3}", point(3).join(point(1)).toString()); LongRangeSet twoTen = range(2, 10); assertEquals("{0, 2..10}", point(0).join(twoTen).toString()); assertEquals("{1..10}", point(1).join(twoTen).toString()); assertEquals("{2..10}", point(2).join(twoTen).toString()); assertEquals("{2..11}", point(11).join(twoTen).toString()); assertEquals("{2..10, 12}", point(12).join(twoTen).toString()); assertEquals("{2..10, 12}", point(12).join(twoTen).toString()); LongRangeSet set = range(10, 20).join(range(30, 40)).join(range(42, 50)); assertEquals("{10..20, 30..40, 42..50}", set.toString()); assertEquals("{8, 10..20, 30..40, 42..50}", set.join(point(8)).toString()); assertEquals("{9..20, 30..40, 42..50}", set.join(point(9)).toString()); assertEquals("{10..21, 30..40, 42..50}", set.join(point(21)).toString()); assertEquals("{10..20, 22, 30..40, 42..50}", set.join(point(22)).toString()); assertEquals("{10..20, 29..40, 42..50}", set.join(point(29)).toString()); assertEquals("{10..20, 30..50}", set.join(point(41)).toString()); assertEquals("{10..20, 30..40, 42..51}", set.join(point(51)).toString()); assertEquals("{10..20, 30..40, 42..50, 52}", set.join(point(52)).toString()); assertEquals("{10..40}", range(20, 30).join(range(10, 40)).toString()); assertEquals("{10..40}", range(10, 40).join(range(20, 30)).toString()); assertEquals("{10..30}", range(10, 20).join(range(20, 30)).toString()); assertEquals("{10..30}", range(20, 30).join(range(10, 20)).toString()); assertEquals("{10..30}", range(10, 19).join(range(20, 30)).toString()); assertEquals("{10..30}", range(20, 30).join(range(10, 19)).toString()); assertEquals("{10..18, 20..30}", range(20, 30).join(range(10, 18)).toString()); assertEquals("{10..18, 20..30}", range(10, 18).join(range(20, 30)).toString()); assertEquals("{-4..8, 10..20, 30..40, 42..50}", range(-4, 8).join(set).toString()); assertEquals("{-4..20, 30..40, 42..50}", range(-4, 9).join(set).toString()); assertEquals("{-4..50}", range(-4, 41).join(set).toString()); assertEquals("{-4..51}", range(-4, 51).join(set).toString()); assertEquals("{10..20, 30..40, 42..60}", range(51, 60).join(set).toString()); assertEquals("{10..20, 30..40, 42..50, 52..60}", range(52, 60).join(set).toString()); assertEquals("{10..20, 30..40, 42..50}", range(12, 14).join(set).toString()); assertEquals("{10..40, 42..50}", range(12, 34).join(set).toString()); assertEquals("{10..50}", range(10, 41).join(set).toString()); assertEquals("{10..50}", range(12, 41).join(set).toString()); assertEquals("{10..50}", range(20, 41).join(set).toString()); assertEquals("{10..50}", range(21, 41).join(set).toString()); assertEquals("{10..20, 22..50}", range(22, 41).join(set).toString()); assertEquals("{10..50}", range(12, 42).join(set).toString()); assertEquals("{10..50}", range(10, 50).join(set).toString()); }