@Test
    void requireThatUpperAndLowerBoundsAreAdjustedWithArity() {
        lowerBound = -999;
        upperBound = 999;
        testConvert("foo in [0..10000]", "foo in [0..10000 (foo=0-999)]", 10);
        testConvert("foo in [0..10000]", "foo in [0..10000 (foo=0-1023)]", 2);
        testConvert("foo in [-10000..10000]", "foo in [-10000..10000 (foo=-999-0,foo=0-999)]", 10);
        testConvert("foo in [-10000..10000]", "foo in [-10000..10000 (foo=-1023-0,foo=0-1023)]", 2);

        upperBound = 1000;
        testConvert("foo in [0..10000]", "foo in [0..10000 (foo=0-9999)]", 10);

        lowerBound = 100;
        upperBound = 999;
        testConvert("foo in [0..10000]", "foo in [0..10000 (foo=0-999)]", 10);
        testConvert("foo in [0..10000]", "foo in [0..10000 (foo=0-1023)]", 2);

        lowerBound = -999;
        upperBound = -100;
        testConvert("foo in [-10000..10000]", "foo in [-10000..10000 (foo=-999-0)]", 10);
        testConvert("foo in [-10000..10000]", "foo in [-10000..10000 (foo=-1023-0)]", 2);

        lowerBound = -9223372036854775790L;
        upperBound = 9223372036854775790L;
        testConvert("foo in [-9223372036854775791..9223372036854775792]",
                "foo in [-9223372036854775791..9223372036854775792 (" +
                        "foo=-9223372036854775790+[..0],foo=9223372036854775790+[..0]," +
                        "foo=-9223372036854775709-9223372036854775700," +
                        "foo=-9223372036854775719-9223372036854775710," +
                        "foo=-9223372036854775729-9223372036854775720," +
                        "foo=-9223372036854775739-9223372036854775730," +
                        "foo=-9223372036854775749-9223372036854775740," +
                        "foo=-9223372036854775759-9223372036854775750," +
                        "foo=-9223372036854775769-9223372036854775760," +
                        "foo=-9223372036854775779-9223372036854775770," +
                        "foo=-9223372036854775789-9223372036854775780," +
                        "foo=-9223372036854775099-9223372036854775000," +
                        "foo=-9223372036854775199-9223372036854775100," +
                        "foo=-9223372036854775299-9223372036854775200," +
                        "foo=-9223372036854775399-9223372036854775300," +
                        "foo=-9223372036854775499-9223372036854775400," +
                        "foo=-9223372036854775599-9223372036854775500," +
                        "foo=-9223372036854775699-9223372036854775600," +
                        "foo=-9223372036854770999-9223372036854770000," +
                        "foo=-9223372036854771999-9223372036854771000," +
                        "foo=-9223372036854772999-9223372036854772000," +
                        "foo=-9223372036854773999-9223372036854773000," +
                        "foo=-9223372036854774999-9223372036854774000," +
                        "foo=-9223372036854709999-9223372036854700000," +
                        "foo=-9223372036854719999-9223372036854710000," +
                        "foo=-9223372036854729999-9223372036854720000," +
                        "foo=-9223372036854739999-9223372036854730000," +
                        "foo=-9223372036854749999-9223372036854740000," +
                        "foo=-9223372036854759999-9223372036854750000," +
                        "foo=-9223372036854769999-9223372036854760000," +
                        "foo=-9223372036854099999-9223372036854000000," +
                        "foo=-9223372036854199999-9223372036854100000," +
                        "foo=-9223372036854299999-9223372036854200000," +
                        "foo=-9223372036854399999-9223372036854300000," +
                        "foo=-9223372036854499999-9223372036854400000," +
                        "foo=-9223372036854599999-9223372036854500000," +
                        "foo=-9223372036854699999-9223372036854600000," +
                        "foo=-9223372036850999999-9223372036850000000," +
                        "foo=-9223372036851999999-9223372036851000000," +
                        "foo=-9223372036852999999-9223372036852000000," +
                        "foo=-9223372036853999999-9223372036853000000," +
                        "foo=-9223372036809999999-9223372036800000000," +
                        "foo=-9223372036819999999-9223372036810000000," +
                        "foo=-9223372036829999999-9223372036820000000," +
                        "foo=-9223372036839999999-9223372036830000000," +
                        "foo=-9223372036849999999-9223372036840000000," +
                        "foo=-9223372036099999999-9223372036000000000," +
                        "foo=-9223372036199999999-9223372036100000000," +
                        "foo=-9223372036299999999-9223372036200000000," +
                        "foo=-9223372036399999999-9223372036300000000," +
                        "foo=-9223372036499999999-9223372036400000000," +
                        "foo=-9223372036599999999-9223372036500000000," +
                        "foo=-9223372036699999999-9223372036600000000," +
                        "foo=-9223372036799999999-9223372036700000000," +
                        "foo=-9223372030999999999-9223372030000000000," +
                        "foo=-9223372031999999999-9223372031000000000," +
                        "foo=-9223372032999999999-9223372032000000000," +
                        "foo=-9223372033999999999-9223372033000000000," +
                        "foo=-9223372034999999999-9223372034000000000," +
                        "foo=-9223372035999999999-9223372035000000000," +
                        "foo=-9223372009999999999-9223372000000000000," +
                        "foo=-9223372019999999999-9223372010000000000," +
                        "foo=-9223372029999999999-9223372020000000000," +
                        "foo=-9223370999999999999-9223370000000000000," +
                        "foo=-9223371999999999999-9223371000000000000," +
                        "foo=-9223309999999999999-9223300000000000000," +
                        "foo=-9223319999999999999-9223310000000000000," +
                        "foo=-9223329999999999999-9223320000000000000," +
                        "foo=-9223339999999999999-9223330000000000000," +
                        "foo=-9223349999999999999-9223340000000000000," +
                        "foo=-9223359999999999999-9223350000000000000," +
                        "foo=-9223369999999999999-9223360000000000000," +
                        "foo=-9223099999999999999-9223000000000000000," +
                        "foo=-9223199999999999999-9223100000000000000," +
                        "foo=-9223299999999999999-9223200000000000000," +
                        "foo=-9220999999999999999-9220000000000000000," +
                        "foo=-9221999999999999999-9221000000000000000," +
                        "foo=-9222999999999999999-9222000000000000000," +
                        "foo=-9209999999999999999-9200000000000000000," +
                        "foo=-9219999999999999999-9210000000000000000," +
                        "foo=-9099999999999999999-9000000000000000000," +
                        "foo=-9199999999999999999-9100000000000000000," +
                        "foo=-999999999999999999-0," +
                        "foo=-1999999999999999999-1000000000000000000," +
                        "foo=-2999999999999999999-2000000000000000000," +
                        "foo=-3999999999999999999-3000000000000000000," +
                        "foo=-4999999999999999999-4000000000000000000," +
                        "foo=-5999999999999999999-5000000000000000000," +
                        "foo=-6999999999999999999-6000000000000000000," +
                        "foo=-7999999999999999999-7000000000000000000," +
                        "foo=-8999999999999999999-8000000000000000000," +
                        "foo=9223372036854775700-9223372036854775709," +
                        "foo=9223372036854775710-9223372036854775719," +
                        "foo=9223372036854775720-9223372036854775729," +
                        "foo=9223372036854775730-9223372036854775739," +
                        "foo=9223372036854775740-9223372036854775749," +
                        "foo=9223372036854775750-9223372036854775759," +
                        "foo=9223372036854775760-9223372036854775769," +
                        "foo=9223372036854775770-9223372036854775779," +
                        "foo=9223372036854775780-9223372036854775789," +
                        "foo=9223372036854775000-9223372036854775099," +
                        "foo=9223372036854775100-9223372036854775199," +
                        "foo=9223372036854775200-9223372036854775299," +
                        "foo=9223372036854775300-9223372036854775399," +
                        "foo=9223372036854775400-9223372036854775499," +
                        "foo=9223372036854775500-9223372036854775599," +
                        "foo=9223372036854775600-9223372036854775699," +
                        "foo=9223372036854770000-9223372036854770999," +
                        "foo=9223372036854771000-9223372036854771999," +
                        "foo=9223372036854772000-9223372036854772999," +
                        "foo=9223372036854773000-9223372036854773999," +
                        "foo=9223372036854774000-9223372036854774999," +
                        "foo=9223372036854700000-9223372036854709999," +
                        "foo=9223372036854710000-9223372036854719999," +
                        "foo=9223372036854720000-9223372036854729999," +
                        "foo=9223372036854730000-9223372036854739999," +
                        "foo=9223372036854740000-9223372036854749999," +
                        "foo=9223372036854750000-9223372036854759999," +
                        "foo=9223372036854760000-9223372036854769999," +
                        "foo=9223372036854000000-9223372036854099999," +
                        "foo=9223372036854100000-9223372036854199999," +
                        "foo=9223372036854200000-9223372036854299999," +
                        "foo=9223372036854300000-9223372036854399999," +
                        "foo=9223372036854400000-9223372036854499999," +
                        "foo=9223372036854500000-9223372036854599999," +
                        "foo=9223372036854600000-9223372036854699999," +
                        "foo=9223372036850000000-9223372036850999999," +
                        "foo=9223372036851000000-9223372036851999999," +
                        "foo=9223372036852000000-9223372036852999999," +
                        "foo=9223372036853000000-9223372036853999999," +
                        "foo=9223372036800000000-9223372036809999999," +
                        "foo=9223372036810000000-9223372036819999999," +
                        "foo=9223372036820000000-9223372036829999999," +
                        "foo=9223372036830000000-9223372036839999999," +
                        "foo=9223372036840000000-9223372036849999999," +
                        "foo=9223372036000000000-9223372036099999999," +
                        "foo=9223372036100000000-9223372036199999999," +
                        "foo=9223372036200000000-9223372036299999999," +
                        "foo=9223372036300000000-9223372036399999999," +
                        "foo=9223372036400000000-9223372036499999999," +
                        "foo=9223372036500000000-9223372036599999999," +
                        "foo=9223372036600000000-9223372036699999999," +
                        "foo=9223372036700000000-9223372036799999999," +
                        "foo=9223372030000000000-9223372030999999999," +
                        "foo=9223372031000000000-9223372031999999999," +
                        "foo=9223372032000000000-9223372032999999999," +
                        "foo=9223372033000000000-9223372033999999999," +
                        "foo=9223372034000000000-9223372034999999999," +
                        "foo=9223372035000000000-9223372035999999999," +
                        "foo=9223372000000000000-9223372009999999999," +
                        "foo=9223372010000000000-9223372019999999999," +
                        "foo=9223372020000000000-9223372029999999999," +
                        "foo=9223370000000000000-9223370999999999999," +
                        "foo=9223371000000000000-9223371999999999999," +
                        "foo=9223300000000000000-9223309999999999999," +
                        "foo=9223310000000000000-9223319999999999999," +
                        "foo=9223320000000000000-9223329999999999999," +
                        "foo=9223330000000000000-9223339999999999999," +
                        "foo=9223340000000000000-9223349999999999999," +
                        "foo=9223350000000000000-9223359999999999999," +
                        "foo=9223360000000000000-9223369999999999999," +
                        "foo=9223000000000000000-9223099999999999999," +
                        "foo=9223100000000000000-9223199999999999999," +
                        "foo=9223200000000000000-9223299999999999999," +
                        "foo=9220000000000000000-9220999999999999999," +
                        "foo=9221000000000000000-9221999999999999999," +
                        "foo=9222000000000000000-9222999999999999999," +
                        "foo=9200000000000000000-9209999999999999999," +
                        "foo=9210000000000000000-9219999999999999999," +
                        "foo=9000000000000000000-9099999999999999999," +
                        "foo=9100000000000000000-9199999999999999999," +
                        "foo=0-999999999999999999," +
                        "foo=1000000000000000000-1999999999999999999," +
                        "foo=2000000000000000000-2999999999999999999," +
                        "foo=3000000000000000000-3999999999999999999," +
                        "foo=4000000000000000000-4999999999999999999," +
                        "foo=5000000000000000000-5999999999999999999," +
                        "foo=6000000000000000000-6999999999999999999," +
                        "foo=7000000000000000000-7999999999999999999," +
                        "foo=8000000000000000000-8999999999999999999)]");

        lowerBound = -922337203685477579L;
        upperBound = 922337203685477579L;
        testConvert("foo in [-9223372036854775791..9223372036854775792]",
                "foo in [-9223372036854775791..9223372036854775792 (foo=-999999999999999999-0,foo=0-999999999999999999)]");
    }
@author <a href="mailto:magnarn@yahoo-inc.com">Magnar Nedland</a>
predicate-search-core/src/test/java/com/yahoo/search/predicate/optimization/ComplexNodeTransformerTest.java