public List<ZAddressRange<Integer>> zOrderSearchCurveIntegers(List<ZValueRange> ranges)
    {
        List<ZAddressRange<Long>> addressRanges = zOrderSearchCurve(ranges);

        List<ZAddressRange<Integer>> integerAddressRanges = new ArrayList<>();
        for (ZAddressRange<Long> addressRange : addressRanges) {
            checkArgument(
                    (addressRange.getMinimumAddress() <= Integer.MAX_VALUE) && (addressRange.getMaximumAddress() <= Integer.MAX_VALUE),
                    format("The address range [%d, %d] contains addresses greater than integers.", addressRange.getMinimumAddress(), addressRange.getMaximumAddress()));

            integerAddressRanges.add(new ZAddressRange<>(addressRange.getMinimumAddress().intValue(), addressRange.getMaximumAddress().intValue()));
        }
        return integerAddressRanges;
    }
@Test
    public void testZOrderSearchUnevenCurves()
    {
        List<Integer> bitPositions = ImmutableList.of(1, 2);
        ZOrder zOrder = new ZOrder(bitPositions);

        List<ZValueRange> ranges = ImmutableList.of(
                new ZValueRange(ImmutableList.of(Optional.of(-2)), ImmutableList.of(Optional.of(0))),
                new ZValueRange(ImmutableList.of(Optional.of(-1)), ImmutableList.of(Optional.of(2))));

        List<ZAddressRange<Integer>> addresses = zOrder.zOrderSearchCurveIntegers(ranges);

        assertEquals(addresses, ImmutableList.of(new ZAddressRange<>(3L, 3L), new ZAddressRange<>(7L, 10L),
                new ZAddressRange<>(12L, 14L), new ZAddressRange<>(19L, 19L), new ZAddressRange<>(24L, 26L)));
    }