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 testZOrderSearchCurveMultipleRanges()
    {
        List<Integer> bitPositions = ImmutableList.of(3);
        ZOrder zOrder = new ZOrder(bitPositions);

        List<ZValueRange> ranges = ImmutableList.of(new ZValueRange(ImmutableList.of(Optional.empty(), Optional.of(6)), ImmutableList.of(Optional.of(-7), Optional.empty())));

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

        assertEquals(addresses, ImmutableList.of(new ZAddressRange<>(0L, 1L), new ZAddressRange<>(14L, 15L)));

        bitPositions = ImmutableList.of(3, 1, 2);
        zOrder = new ZOrder(bitPositions);

        ranges = ImmutableList.of(
                new ZValueRange(ImmutableList.of(Optional.empty(), Optional.of(6)), ImmutableList.of(Optional.of(-7), Optional.empty())),
                new ZValueRange(ImmutableList.of(Optional.of(0)), ImmutableList.of(Optional.empty())),
                new ZValueRange(ImmutableList.of(Optional.of(1)), ImmutableList.of(Optional.of(1))));

        addresses = zOrder.zOrderSearchCurveIntegers(ranges);

        assertEquals(addresses, ImmutableList.of(
                new ZAddressRange<>(194L, 195L), new ZAddressRange<>(210L, 211L),
                new ZAddressRange<>(486L, 487L), new ZAddressRange<>(502L, 503L)));
    }