static void checkValidSliceRange(int sourceIndex, int length)
    {
        //sourceIndex + length can overflow integer range
        if (sourceIndex > MAX_ARRAY_SIZE - length) {
            throw new SliceTooLargeException(format("Cannot allocate slice larger than %d bytes", MAX_ARRAY_SIZE));
        }
    }
@Test
    public void testCheckValidSliceRange()
    {
        BlockUtil.checkValidSliceRange(MAX_ARRAY_SIZE - 10, 9);
    }